Commit 57f06cd7 by BellCodeEditor

save project

parent 281c798c
Showing with 14 additions and 6 deletions
def s():
a=[]
while True:
money=input("请输入(z退出):")
if money=="z":
n=input("请输入(z退出):")
if n=="z":
break
else:
try:
money=int(money)
n=int(n)
except:
print("请重新输入:")
else:
a.append(money)
a.append(n)
print("="*100)
return a
def sum(money):
c=0
for i in money:
c=c+i
return c
x=s()
print(x)
\ No newline at end of file
p=sum(x)
print("你一共消费了"+str(p)+"元!!!请付账!!!!!")
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