Commit befdbe03 by BellCodeEditor

save project

parent e0a5d0c6
Showing with 10 additions and 9 deletions
food={"香蕉":3,"西瓜":5} food={"香蕉":3,"西瓜":5}
k=input("写出水果名") while True:
p=input("写出水果价格") k=input("写出水果名")
if k in food: p=input("写出水果价格")
if int(p)<food[k]: if k in food:
food[k]=int(p) if int(p)<food[k]:
food[k]=int(p)
else:
print("比之前便宜")
else: else:
print("比之前便宜") food[k]=int(p)
else: print("添加成功")
food[k]=int(p)
print("添加成功")
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