Commit 8312c182 by BellCodeEditor

auto save

parent a6e4671f
Showing with 7 additions and 12 deletions
cost={'苹果':5.2,'山竹':12.9,'香蕉':2.4,'荔枝':15,'葡萄':9.3} # 神奇百货中的物品已经帮你创建好啦,接下来要看你的了~
k=input('请输入水果名称:') dict= {'可口可乐':3,'旺仔牛奶':4,'农夫山泉':1,'辣条':3,'巴西烤肉':2,'果冻':4,'乐事':5,'奥利奥':10,'巧克力':6}
v=input("请输入水果价钱:") k=input('你想要买什么?')
if k in cost: if k in dict:
if float(v)<cost[k]: print('叮咚'+'您的'+k+'需要'+str(dict[k])+'元')
cost [k]=float(v)
print(k+'降价了,现价'+v+'元')
else:
print(k+'涨价了,我们不买')
else: else:
cost[k]=float(v) print('对不起,没有您想要的商品,敬请期待')
print(k+'的价钱'+v+'元已上传--') \ No newline at end of file
\ 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