Commit 7b501e8c by BellCodeEditor

auto save

parent 437d674d
Showing with 13 additions and 0 deletions
cost= {'苹果':5.2,'山竹':12.9,'香蕉':2.4,'荔枝':15,'葡萄':9.3,'桂圆':8,'蓝莓':10,'李子':8}
k=input("请输入水果名称:")
m=input("请输入水果的单价:")
if k in cost:
if float(m)<cost[k]:
cost[k]=float(m)
print("价格更新了,现价是"+str(cost[k])+"元")
else:
print("太贵了,我们不买")
else:
cost[k]=float(m)
print("你的水果已更新到系统")
\ 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