Commit 42f9d8ae by BellCodeEditor

save project

parent a79e1a63
Showing with 15 additions and 0 deletions
cost= {'苹果':5.2,'山竹':12.9,'香蕉':2.4,'荔枝':15,'葡萄':9.3,'桂圆':8,'蓝莓':10,'李子':8}
while True:
k=input('请输入一种水果:')
v=float(input('请输入这个水果的价钱:'))
if k in cost:
if v<cost[k]:
cost[k]=v
print(k+'降价了,现在只要'+str(v)+'元')
else:
print(k+'还没以前便宜呢!')
else:
cost[k]=v
print('价格单更新')
print(cost)
\ 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