Commit cca02989 by BellCodeEditor

save project

parent f56073cb
Showing with 12 additions and 6 deletions
dict={'可口可乐':3,'旺仔母牛奶':4,'农夫山泉':1,'巴西烤肉':2} cost={'苹果':5.2,'香蕉':2.4,'山竹':12.9,'桂圆':8}
k=input("你想要什么") k=input("你要哪个是个水果")
if k in dict: v=input("价钱")
print('叮~您的'+k+'要支付'+str(dict[k])+'元~') if k in cost:
if float(v)<cost[k]:
cost[k]=float(v)
print(k+'降价了,现价'+v+'元')
else:
print(k+'涨价了,不买')
else: else:
print("没有") cost[k] = float(v)
\ No newline at end of file print(k+'的钱'+v+'元已上传~')
\ 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