Commit 270e3435 by BellCodeEditor

save project

parent 7eaed43a
Showing with 26 additions and 0 deletions
def sbzrz():
dsbzrz=[]
while True:
qjdsbzrz=input("(q退出)请输入:")
if qjdsbzrz=="q":
break
else:
try:
qjdsbzrz=int(qjdsbzrz)
except:
print("请重新输入数字")
else:
dsbzrz.append(qjdsbzrz)
finally:
print("-"*30)
return dsbzrz
def sum(money):
count=0
for i in money:
count=count+i
return count
lxgzrz=sbzrz()
lspzrz=sum(lxgzrz)
print("你一共消费了"+str(lspzrz)+"元")
\ 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