python 简易计算器程序,代码就几行
代码:
代码如下:
import os
while True:
dynamic = input('输入计算表达式:')
if dynamic != 'cls':
try:
result = eval(dynamic)
print('计算结果:'+str(result))
except:
print('计算表达式输入有误!')
else:
command = 'cls'
os.system(command) 相关推荐
FlySky 2020-09-29
Phplayers 2020-09-05
oXiaoChong 2020-06-03
class Singleton: def __new__: # 关键在于这,每一次实例化的时候,我们都只会返回这同一个instance对象 if not hasattr: cls.instance =
lhxxhl 2020-05-16
laohyx 2020-04-06
pengkunstone 2020-02-22
codeAB 2020-01-19
逍遥友 2019-12-30
typhoonpython 2019-11-19
amazingbo 2019-06-30
pythonxuexi 2019-06-28
ruoyiqing 2016-10-13
cjb 2019-06-28
小方哥哥 2019-06-27
hualicc 2010-05-04
manbucy 2010-03-03
jibkfv 2019-06-20