代码:
复制代码 代码如下:
import os
while True:
dynamic = input('输入计算表达式:')
if dynamic != 'cls':
try:
result = eval(dynamic)
print('计算结果:'+str(result))
except:
print('计算表达式输入有误!')
else:
command = 'cls'
os.system(command)
Copyright© 2013-2020
All Rights Reserved 京ICP备2023019179号-8