My very simple calculator
I wrote, configured, and debugged code for a calculator with eventual success. I posted it to this website and have found that it doesn't operate properly. Perhaps because it is an interpreter? Clarification on this issue and how it can remedied would be greatly appreciated. Perhaps with better constructed code - although I find it pleasantly done? Here is the code: (Copy/paste into new document in IDLE and run; it works. Copy/paste into Interpreter; results in error.) print('I shall compute your mathematical equation!') while True: user_operation = input('Please type and enter what operation you would like to perform: \n Addition \n Subtraction \n Multiplication \n Division \n \n ...or \n Quit to exit.\n') if user_operation in ('Quit','quit'): print('Closing...') break elif user_operation not in ('Addition','addition','+','Subtraction','subtraction','-','Multiplication','multiplication','x','*','Division','division','/'): print('Invalid input! Please try again!') continue else: user_num1 = int(input('What is your first number?')) user_num2 = int(input('What is your second number?')) if user_operation in ('Addition','addition','+'): addsum = str(user_num1 + user_num2) print('Your result is ' +addsum+ ' !') elif user_operation in ('Multiplication', 'multiplication','x','*'): addsum = str(user_num1 * user_num2) print('Your result is ' +addsum+ ' !') elif user_operation in ('Subtraction','subtraction','-'): addsum = str(user_num1 - user_num2) print('Your result is ' +addsum+ ' !') elif user_operation in ('Division','division','/'): addsum = str(user_num1 / user_num2) print('Your result is ' +addsum+ ' !') quit() Thanks in advance.