Loading, please wait...

Sorting

To sort word in a sentence in ascending order

 

Code:

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

 

Then, Click on the run button to execute it.