Commit cbf1dab5 by BellCodeEditor

save project

parent 2c480ffe
Showing with 12 additions and 7 deletions
......@@ -15,4 +15,7 @@ print(len(dict_hero))
print(dict_hero['猴三'])
dict_hero['猴三']=1231
print(dict_hero['猴三'])
\ No newline at end of file
print(dict_hero['猴三'])
dict_hero['sassa']=132123
print(dict_hero)
\ 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))
\ No newline at end of file
dict = {'牛奶':3,'饼干':3,'巧克力':5,'水':8,'茉莉花茶':5}
a = input("您想要买些什么?")
if a in dict:
print('您购买的'+a+'需要'+str(dict[a])+'元')
else:
print('商品已售空')
\ 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