Commit a4977224 by BellCodeEditor

auto save

parent 0c88e1e0
Showing with 14 additions and 2 deletions
dict= {'可口可乐':3,'旺仔牛奶':4,'农夫山泉':1,'辣条':3,'巴西烤肉':2,'果冻':4,'乐事':5,'奥利奥':10,'巧克力':6,'冰红茶':5,'玩具车':30,'口香糖':1}
s=input("你要什么?")
if s in dict:
print("你的东西来了"+s+"请付钱"+str(dict[s])+"元")
else:
print("对不起,此物品暂时缺货.")
\ No newline at end of file
...@@ -14,12 +14,17 @@ ...@@ -14,12 +14,17 @@
# 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典 # 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典
dict_hero={"猴三":10,'猴一':21,'猴五':22,'猴队长':29,'猴七':30} dict_hero={"猴三":10,'猴一':21,'猴五':22,'猴队长':29,'猴七':30}
dict_hero["猴队长"]=100 dict_hero["猴队长"]=100
dict_hero["猴夫人"]=110 dict_hero["猴夫人"]=110
if "猴夫人" in dict_hero: if "猴夫人" in dict_hero:
print(ict_hero) print(dict_hero)
print(dict_hero) # print(dict_hero)
# 直接运行以下代码,说说你的发现:测试代码长度 # 直接运行以下代码,说说你的发现:测试代码长度
......
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