Commit f45a3c8f by BellCodeEditor

save project

parent dc70412a
bl={"红烧肉":1688, "糖醋里脊":168, "西红柿鸡蛋":998, "螺狮粉":888, "鲱鱼罐头":1968}
def 求总价():
while True:
x=input("你想要什么菜?")
if x in bl:
y=input("第二个菜?")
if y in bl :
z=input("第三个菜?")
if z in bl:
xyz=bl[x]+bl[y]+bl[z]
print("你需要支付"+str(xyz)+"元")
else:
print("木有这道菜。")
else:
print("木有这道菜。")
else:
print("木有这道菜。")
求总价()
def h():
a=[]
while True:
b=input("?")
if b=="a":
break
else:
try:
b=int(b)
except:
print("请重新输入一个数字。")
else:
a.append(b)
print("-"*30)
return a
r=h()
print(r)
\ No newline at end of file
import f
求总价()
\ 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