Python Program to Sort Words in Alphabetic Order


Topic: Python Program to Sort Words in Alphabetic Order

Solution

my_str = "Hello this Is an Example With cased letters"
words = [word.lower() for word in my_str.split()]
words.sort()
print("The sorted words are:")
for word in words:
   print(word)



List all Python Programs