def sortLexo(my_words):
# Split the my_words till where space is found.
words = my_words.split()
# sort() is used to sort strings
words.sort()
for i in words:
print(i)
if __name__ == '__main__':
# in order to sort your words you need to enter your words below
my_words = "Enter your words here "
sortLexo(my_words)
Comments
Leave a comment