Commit 9e5e7e1c by BellCodeEditor

save project

parent dc70412a
Showing with 30 additions and 0 deletions
#total = []
def new_input():
total = []
while True:
momey= input("请输入:")
if momey == 'q':
break
else:
try:
momey=int(unit)
except:
print('请重输')
else:
total.append(momey)
finally:
print("-"*30)
return total
def sum(unit)
count=0
for i in unit:
count=count+i
return count
result=new_input()
pay=sum(result)
print(你花了+"str(pay)"+)
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