Commit 3837a1b6 by BellCodeEditor

save project

parent dc70412a
Showing with 26 additions and 0 deletions
def new():
total=[]
while True:
u= input("请输入:")
if u== 'q':
break
else:
try:
u=int(u)
except:
print("wrong,again!")
else:
total.append(u)
# finally:
# print("-"*30)
return total
re = new()
#print(re)
def sum(money):
count=0
for u in money:
count=u+count
return count
tttt=sum(re)
print("您一共消费了"+str(tttt)+"元!扫码还是现金?")
\ No newline at end of file
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