Commit b0c15db5 by BellCodeEditor

save project

parent 259c597d
Showing with 8 additions and 0 deletions
dict={'可口可乐':5,'辣条':10,'奥利奥':13,'巧克力':5}
a=input("你要什么,快快招来!")
if a in dict:
print('商品是'+a+'价格为'+str(dict[a]))
else:
print("此商品以无库存或没有此物品。")
\ No newline at end of file
...@@ -11,4 +11,5 @@ ...@@ -11,4 +11,5 @@
# 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典 # 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典
dict_hero={'蛟龙':500,'悟空':10000,'托塔李天王':1000000000000} dict_hero={'蛟龙':500,'悟空':10000,'托塔李天王':1000000000000}
dict_hero['蛟龙']=1000 dict_hero['蛟龙']=1000
dict_hero['鞍山舰']=157157157157157157157
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