Commit ad11d04f by BellCodeEditor

save project

parent 8e04c479
Showing with 13 additions and 2 deletions
...@@ -9,5 +9,8 @@ ...@@ -9,5 +9,8 @@
# break # break
# print(list_hero) # print(list_hero)
# 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典 # 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典
dict_hero={} dict={}
print(dict_hero) print(dict)
dict['孙悟空']='老大'
dict['白骨精']='妖怪'
print(dict)
\ No newline at end of file
dict={'可乐':3,'旺仔牛奶':4,'水':1,'辣条':3,'烤肉':2}
k=input("干啥?")
if k in dict:
print(dict[k])
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