#calculatorIf.py #simple arithmetic expression of integer operator (+ - * / %) integer result = float('inf') #largest possible numeric value num1 = eval(input("Enter number: ")) op = input("Enter operation symbol (+ - * / %): ") num2 = eval(input("Enter number: ")) #multiway branch if op == "+": result = num1 + num2 elif op == "-": result = num1 - num2 elif op == "*": result = num1 * num2 elif op == "/": result = num1 / num2 elif op == "%": result = num1 % num2 else: print("Invalid operator!") if result != float('inf'): #was changed because was valid op print("=", result)