134k views
2 votes
Write a program that asks the user for three names, then prints the names in reverse order.

Sample Run:

Please enter three names:
Zoey
Zeb
Zena

Zena Zeb Zoey


Hint: One solution to this challenge would be to use 3 separate variables, one for each name.

User Dan Evans
by
4.1k points

1 Answer

2 votes

Answer:

print("Please enter three names:")

name1 = input()

name2 = input()

name3 = input()

print(name3 + " " + name2 + " " + name1)

Step-by-step explanation:

*The code in Python.

Ask the user to enter three names

Store these names in variables name1, name2 and name3

Print the variables in the following order name3, name2, name1

User Headshota
by
4.1k points