Question: So I made a calculator program in Python, and now I need to add a loop until the user uses the menu option to exit
So I made a calculator program in Python, and now I need to add a loop until the user uses the menu option to exit the program and I am not sure how to do that. Below is my previous code.

number_1= int(input("Please enter the first number: ")) number_2= int(input("Please enter the second number:)) operation_variable=input("Please enter the operation you would like to perform:") if operation_variables="+": result_variable=number_1+number_2 print("The sum=", result_variable) elif operation_variable="-": result_variable=number_1-number_2 print("The difference = "result_variable) elif operation_variables="*". result_variable=number_1*number_2 print("The product = ".result_variable) elif operation_variables="/": if number_2 !=0 result_variable=number_1umber_2 print("The quotient=", result_variable) print("You cannot divide by 0")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
