Objective
Develop a Python program to prompt the user for three letters and display them in reverse order.
Example Python Exercise
Show Python Code
# Prompt the user for three letters
letter1 = input("Enter the first letter: ")
letter2 = input("Enter the second letter: ")
letter3 = input("Enter the third letter: ")
# Display the letters in reverse order
print(f"The letters in reverse order are: {letter3} {letter2} {letter1}")
Output
Case 1:
Enter the first letter: a
Enter the second letter: b
Enter the third letter: c
The letters in reverse order are: c b a
Case 2:
Enter the first letter: x
Enter the second letter: y
Enter the third letter: z
The letters in reverse order are: z y x
Share this Python Exercise
More Python Programming Exercises of Python Data Types
Explore our set of Python Programming Exercises! Specifically designed for beginners, these exercises will help you develop a solid understanding of the basics of Python. From variables and data types to control structures and simple functions, each exercise is crafted to challenge you incrementally as you build confidence in coding in Python.
This Python program prompts the user to input a symbol and a width, then displays a triangle of the specified width using that symbol for the inner part...
This Python program prompts the user for a username and a password (both should be strings) and repeats the process until the correct credentials are en...
This Python program prompts the user for two numbers and an operation to perform on them, such as addition (+), subtraction (-), multiplication (*), or divisio...
This Python program calculates the perimeter, area, and diagonal of a rectangle, based on the given width and height. The perimeter is cal...
This Python program displays the values of the function y = x² - 2x + 1 for integer values of x ranging from -10 to +10. The function is a quadratic equation, ...
This Python program "draws" the graph of the function y = (x-4)² by displaying a series of asterisks on the screen. For each x value ranging from -1 to 8, the ...