Use functions and loops together to build a mini menu-driven app. The program keeps running until the user chooses to exit.
YOUR TASK
Create a program with a menu that:
Shows options: 1. Add, 2. Multiply, 3. Exit
Asks the user to choose an option
For Add and Multiply: asks for two numbers and prints the result
Keeps looping until the user picks 3 to exit
Need a hint?
Step-by-step:
1. Write functions: def add(a, b): return a + b
2. Use while True: for the menu loop
3. Print the menu options each iteration
4. Get choice: choice = input("Choose: ")
5. Use if/elif: choice "1" → add, "2" → multiply, "3" → break
6. print("Result:", result)
Console initialized...
Ready for Project 5: Simple Menu System
> Test your code with the "Check My Code" button
> When it works, the Complete button will activate!