Commit 1242fcd9 by BellCodeEditor

save project

parent 12e285c5
Showing with 20 additions and 0 deletions
price={"苹果":2,"香蕉":3,"西瓜":5,"樱桃":20,"葡萄":7,"芒果":6}
price={"苹果":2,"香蕉":3,"西瓜":5,"樱桃":20,"葡萄":7,"芒果":6}
k=input("请输入您想购买的水果")
b=input("请输入今日该水果的单价")
if b
\ No newline at end of file
price={"苹果":2.2,"香蕉":3.5,"西瓜":5.0,"樱桃":20.0,"葡萄":7.8,"芒果":6.4}
price={"苹果":2.2,"香蕉":3.5,"西瓜":5.0,"樱桃":20.0,"葡萄":7.8,"芒果":6.4}
k=input("请输入您想购买的水果:")
b=input("请输入今日该水果的单价:")
if k in price:
if float(b)<price[k]:
print("妈妈,水果降价了")
else:
print("妈妈,水果涨价了,我们不买")
else:
price[k]=float(b)
print("添加了水果"+str(k)+",单价为"+str(b)+"元")
print(price)
\ 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