Answers for "how to check alphabetical order in python"

0

checking if a string is in alphabetical order in python

def isInAlphabeticalOrder(word):
    for i in range(len(word) - 1):
        if word[i] > word[i + 1]:
            return False
    return True
Posted by: Guest on September-04-2021
1

python alphabetical order

my_str = "you can just put in word in one sentence like this"
my_str = input("Enter a string: ")
words = [word.lower() for word in my_str.split()]
words.sort()
print("The sorted words are:")
for word in words:
   print(word)
Posted by: Guest on November-18-2021

Code answers related to "how to check alphabetical order in python"

Python Answers by Framework

Browse Popular Code Answers by Language