Commit dc6c675c by BellCodeEditor

save project

parent 803d6c71
Showing with 12 additions and 16 deletions
'''dict_hero={'猴儿':10,'猴一':21,'猴队长':29,'猴七':30}
print(dict-hero)
#提取猴队长的臂力值
print(dict-hero['猴队长'])
#修改猴七的臂力值为32
dict_hero['猴七']=32
print(dict_hero)
#猴十的臂力值是25,请补充进字典
dict_hero['猴十']=25
print(dict_hero)'''
dict={'米饭':9999999999}
k=input('你要买什么?')
if k in dict:
print('叮咚你的'+k'需支付'+str(dict[k])+'元')
cost= {'苹果':5.2,'山竹':12.9,'香蕉':2.4,'荔枝':15,'葡萄':9.3,'桂圆':8,'蓝莓':10,'李子':8}
k=input('请输入水果名称:')
v=input('请输入水果价钱:')
if k in cosg:
if float(v)<cost[k]:
cost[k]=float(v)
print(k+'降价了,现价'+v+'元')
else:
print('本商店没有卖')
\ No newline at end of file
print(k+'涨价了,我们不买')
else:
cost[k] = float(v)
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