Commit 1fe6a19a by BellCodeEditor

auto save

parent a50fab54
Showing with 12 additions and 8 deletions
dict={'可乐':3,'牛奶':4,'水':1,'辣条':3,'烤肉':2,'果冻':4,'乐事':5,'奥利奥':9}
k=input("你要买什么?")
if k in dict:
print('')
\ No newline at end of file
# 直接运行以下代码,说说你的发现:
list_hero=['赵一',30,'丁二',37,'孙五',52,'王猛',89,'周亮',98]
dict_hero = {'赵一':30,'丁二':37,'孙五':52,'王猛':89,'周亮':98}
print(len(list_hero))
print(len(dict_hero))
print(dict_hero['赵一'])
dict={'可乐':3,'牛奶':4,'水':1,'辣条':3,'烤肉':2,'果冻':4,'乐事':5,'奥利奥':9}
k=input("你要买什么?")
if k in dict:
print('您的'+k+'需要支付'+str(dict[k])+'元$')
else:
print('无')
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