Home >>Python Programs >Python Program to Sort Words in Alphabetic Order
In this example, we will see a Python program to sort the words alphabetic order. Sorting is the process of arrangement. It arranges the data systematically in a particular format.
Example :
my_str = input("Enter a string: ")
# breakdown the string into a list of words
words = my_str.split()
# sort the list
words.sort()
# display the sorted words
for word in words:
print(word)