Create a Python program that:
The program should:
Python code:
#accepting the sentence, converting it to list and sorting it
ans saving it in sentence
sentence=sorted(input("Enter sentence or phrase: ").split())
#printing contents in sentence list seperated by newline
print(*sentence,sep="\n")
#printing all the items in the list has been displayed
print("All the items in the list has been displayed.")
Screenshot:
Input and Output:
Get Answers For Free
Most questions answered within 1 hours.