Commit 0229a08f by BellCodeEditor

save project

parent 31ad9f7b
Showing with 15 additions and 1 deletions
goods = {'可口可乐':3,'旺仔牛奶':4,'农夫山泉':1,'辣条':3,'巴西烤肉':2,'果冻':4,'乐事':5,'奥利奥':10,'巧克力':6}
# 请将"农夫山泉"删掉,并打印出新的商品信息
pop(goods["农夫山泉"])
print('goods')
\ No newline at end of file
...@@ -7,8 +7,15 @@ if k in cost: ...@@ -7,8 +7,15 @@ if k in cost:
if float(v)<cost[k]: if float(v)<cost[k]:
cost[k]=float(v) cost[k]=float(v)
print(k+'降价了,现价'+v+'元') print(k+'降价了,现价'+v+'元')
else: elif float(v)==cost[k]:
print('价格没变')
else:
print(k+'涨价了,我们不买') print(k+'涨价了,我们不买')
else: else:
cost[k] = float(v) cost[k] = float(v)
print(k+'的价钱'+v+'元已上传~') print(k+'的价钱'+v+'元已上传~')
没有更多了
应容恩
A
2021-08-22 19:04
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