Pythondex

Exercise

Calculator Exercise 2: Create Operation Menu

In this exercise, you’ll create a menu that lets the user choose which arithmetic operation to perform: addition, subtraction, multiplication, or division.

Task

Write a Python program that:

  • Displays a menu of operations to the user
  • Asks the user to enter a choice (1 for addition, 2 for subtraction, etc.)
  • Prints the user’s choice as entered

Example Output

Solve