Commit 5ee3bf75 by BellCodeEditor

save project

parent 05e7d622
Showing with 30 additions and 0 deletions
def sum(money):
ff=0
for i in money:
ff=ff+i
return ff
def new_input():
total = []
while True:
fie= input("请输入价格(q退出)")
if fie=="q":
break
else:
try:
fie = int(fie)
except:
print("输入错误重新输入")
else:
total.append(fie)
print("111111111111",total)
return total
total=new_input()
print('2222222222222222',total)
ff=sum(total)
print(ff)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment