186k views
2 votes
Write a program that asks the user to enter three different names and then sorts and display names in ascending order. For example, if the names "Maria", "Kelley", and "Angie" were entered, the program will display: Names in sorted order are: FIRST: Angie SECOND: Kelley THIRD: Maria Use printf(...) method for your display.

1 Answer

5 votes

Step-by-step explanation:

n1=str(input('Enter a name:'))

n2=str(input('Enter a name:'))

n3=str(input('Enter a name:'))

y=[n1,n2,n3]

y.sort()

print (y)

User Meules
by
3.8k points