Commit 030b65d0 by BellCodeEditor

save project

parent 1a0c506f
Showing with 16 additions and 11 deletions
# 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典 dict={'可口可乐':3,'旺仔牛奶':4,'农夫山泉':1,'辣条':3,'巴西烤肉':2,'果冻':4,'乐事':5,'奥利奥':10,'巧克力':6}
dict_hero={'猴三':10,'猴一':21,'猴五':22,'猴队长':29,'猴七':30} j=input("你要买啥子")
print(dict_hero) if j in dict:
dict_hero["猴十"]=32 print((dict[j])+'一亿元')
\ No newline at end of file
else:
print('没货,退!退!退!')
\ No newline at end of file
# 直接运行以下代码,说说你的发现: dict={'可口可乐':3,'旺仔牛奶':4,'农夫山泉':1,'辣条':3,'巴西烤肉':2,'果冻':4,'乐事':5,'奥利奥':10,'巧克力':6}
list_hero=['赵一',30,'丁二',37,'孙五',52,'王猛',89,'周亮',98] j=input("你要买啥子")
dict_hero = {'赵一':30,'丁二':37,'孙五':52,'王猛':89,'周亮':98} if j in dict:
print(len(list_hero)) print((dict[j])+'一亿元')
print(len(dict_hero))
\ No newline at end of file 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