num1 = int(input("Enter your first number: ")); num2 = int(input("Enter your second number: "));
pass1 = -1; while (pass1 < 0): try: num1 = int(input("Enter your first number: ")); pass1 = 10; except ValueError: pass1 = -1; print("That is not a valid number. It must be a whole number..."); pass2 = -1; while (pass2 < 0): try: num2 = int(input("Enter your second number: ")); pass2 = 10; except ValueError: pass2 = -1; print("That is not a valid number. It must be a whole number...");
pass3 = -1; while (pass3 < 0): try: action = input("Enter your action (+/*-): "); if (action == "+" or action == "-" or action == "/" or action == "*"): pass3 = 10; except: pass3 = -1; print("That is not a valid action. It must be +, -, /, or *...");
if (action == "+"): end = num1 + num2; elif (action == "-"): end = num1 - num2; elif (action == "/"): end = num1 / num2; elif (action == "*"): end = num1 * num2; else: print("Error...");
print("Your result is: " + str(end))