func.py
405 Bytes
def new_input():
total = []
while True:
unit = input("请输入:")
if unit == "q":
break
try:
unit= int(unit)
except:
print("重新")
else:
total.append(unit)
return total
def sun(monny):
count =0
for i in monny:
count=count+i
return count
# price=new_input()
# pay=sun(price)