I'm making a PEMDAS solver and don't know what to write

血红的双手。 提交于 2019-12-20 06:03:01

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!