0
Calculator on Python
Why is this code not working? number1 = int(input("What is your first number?")); operator = input("What is your operator?"); number2 = int(input("What is your second number")); if operator == "+": answer = number1 + number2; elif operator == "/": answer = number1 / number2; elif operator == "*": answer = number1 * number2; elif operator == "-": answer = number1 - number2; print("The answer is" + str((answer)
5 Answers
+ 1
I will see if it works
+ 1
It works which means I am an idiot. Thanks!
+ 1
i = input()
print(i," = ",eval(i))