Python Programming - Console Input/Output - Discussion

Discussion Forum : Console Input/Output - General Questions (Q.No. 73)
73.
How can you prompt the user to enter a list of words, sort them alphabetically, and print the result?
sorted_words(get_user_words())
print("Sorted words:", sort_alphabetically(input("Enter words separated by spaces: ").split()))
words = input("Enter words separated by spaces: ").split(); print("Sorted words:", sort_words(words))
sort_input_words(input("Enter a list of words: "))
Answer: Option
Explanation:
To prompt the user to enter a list of words, sort them alphabetically, and print the result, use words = input("Enter words separated by spaces: ").split(); print("Sorted words:", sort_words(words)).
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.