linux系统中,执行如下操作
现在我想写一个py脚本,在脚本中执行如上操作,该怎么实现呢?
userInput = input('请输入如1+2这样的式子:') print('结果: {}'.format( eval( userInput ) ))