sum = 0
def sum_num(*args):
for i in args:
global sum
sum += i
print(f'所加数字和为{sum}')
while True:
print('1 计算 2 退出')
choose = int(input('请输入:'))
if choose == 1:
while True:
x = int(input('请输入需要计算的数字:'))
sum_num(x)
elif choose == 2:
print('退出系统')
break
else:
print('强制退出!')
break
这会不会是计算器的原理呢