I am trying to make calculator that can solve expressions with basic 4 operators, like 1+2*3-4/5, however it does not work and I do not know what is wrong. Please check my code.
I have an alternative to your code. The user can enter stuff like: 8*6/4-3+3 and this will still work. Very compact and if you want a command to exit out of the:
while True:
Just add:
if(y == "end" or y == "End"):
break
And it will exit out of the "while True:"
Code (Python v3.3.0):
while True:
x = "x="
y = input(" >> ")
x += y
exec(x)
print(x)