Commit 7c5d244a by BellCodeEditor

save project

parent a346e611
Showing with 19 additions and 5 deletions
def a():
b=[]
while True:
c=input("您的菜品名称是什么:")
c=input("您的菜品价格(按‘d’退出):")
if c=="d":
break
else:
b.append(c)
print(b)
a()
\ No newline at end of file
try:
c=int(c)
except:
print('请输入整数!!!!!!!!')
else:
b.append(c)
print("-"*30)
return b
def f(g):
h=0
for i in g:
h=h+i
return h
e=a()
print(e)
j=f(e)
print("共消费:"+str(j))
\ 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