基础加法运算器新鲜出炉啦!
- import time
- print('基础加法运算器\n由于作者能力有限,只会做两个数的加法-_-\'')
- a = input('请输入加法算式(例:12+88):')
- ram = a.split('+')
- ram.append(0)
- ram[2] = int(ram[0])
- ram[0] = ram[2]
- ram[2] = int(ram[1])
- ram[1] = ram[2]
- ram[2] = 0
- print('思考中...')
- for i in range(ram[0]):
- ram[2] = ram[2] + 1
- time.sleep(0.01)#思考特效
- for i in range(ram[1]):
- ram[2] = ram[2] + 1
- time.sleep(0.01)#思考特效
- print(ram[2])
复制代码
|