func.py
460 Bytes
def new_input():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
try:
unit=int(unit)
except:
print("要输入整数哦")
else:
total.append(unit)
print(total)
return total
def sum(money):
count=0
for i in money:
count=cont+i
print(count)
return count