Commit 827d62b0 by BellCodeEditor

auto save

parent 7eaed43a
Showing with 25 additions and 0 deletions
def caidan():
a=[]
while True:
b=input("请输入菜单价格:")
if b=="q":
break
else:
try:
b=int(b)
except:
print("输入错误")
else:
a.append(b)
return a
def add(tp):
d=0
for i in tp:
d=d+i
return d
c=caidan()
e=add(c)
print("您需要支付:",e,"元")
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