问题
I am trying to make a PEMDAS solver where the user types in a PEMDAS problem. For example, they would type in 4(4 + 2) - 5 and the program would solve it for them. is there any code that would make python solve the input that the user enters.
something like:
problem = input()
solve(problem)
print(problem)
I obviously know that "solve" is not a real command in python.
来源:https://stackoverflow.com/questions/13182459/im-making-a-pemdas-solver-and-dont-know-what-to-write