Commit c7bad4e5 by BellCodeEditor

save project

parent 83b73772
Showing with 13 additions and 0 deletions
dict={'苹果':5.5,'西瓜':2.5,'香瓜':3.2,'车栗子':18}
k=input('请输入水果名称:')
v=input('请输入水果价钱:')
if k in dict:
if float(v)<dict[k]:
dict[k]=float(v)
print(k+'在这家店只要'+v+'元,'+'我们可以买这家的')
else:
print('这家店更贵,不买')
else:
dict[k]=float(v)
print(k+'的价钱已经记录了')
\ 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