Commit 6a520b84 by BellCodeEditor

save project

parent 83b73772
Showing with 17 additions and 0 deletions
fruit={"苹果":3,"葡萄":2,"西瓜":2}
k=input("您今天想要买什么水果")
b=input("请输入水果的价钱")
if k in fruit:
if int(b)<fruit[k]:
print("水果价钱降低了")
else:
print("涨价了,我们不买")
else:
fruit[k]=int(b)
print("已将"+k+"添加到字典中,"+"价格是"+b+"元")
\ No newline at end of file
fruit={"苹果":3,"葡萄":2,"西瓜":2}
fruit={"苹果":3,"葡萄":2,"西瓜":2}
k=input("您今天想要买什么水果")
b=input("请输入水果的价钱")
\ 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