func.py
473 Bytes
def jill():
total = []
while True:
unit = input("请输入:")
if unit== 'q':
break
else:
try:
unit = int(unit)
except:
print("数字!!!")
else:
total.append(unit)
return total
print(total)
def s(m):
c = 0
for i in m:
c = c + i
return c
p = new_input()
pay = s(p)
print("你一共付"+str(pay)+"元")