Commit 1cf39fea by BellCodeEditor

save project

parent 86d4a66f
Showing with 12 additions and 2 deletions
...@@ -9,5 +9,9 @@ ...@@ -9,5 +9,9 @@
#break #break
#print(list_hero) #print(list_hero)
# 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典 # 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典
dict_hero={'猴三':10,'猴一':21,'猴五':22,'猴队长':29,'猴七':30} dict={'可乐':3,'牛奶':4,'水':2,'辣条':1,'果冻':4,'巧克力':5,'烤肉':2}
print(dict_hero) k=input('你要买什么?')
if k in dict:
print('叮咚,您的'+k+'需支付'+str(dict[k])+'元')
else:
print('没货')
dict={'可乐':3,'牛奶':4,'水':2,'辣条':1,'果冻':4,'巧克力':5'烤肉':2}
k=input('你要买什么?')
if k in dict:
print('叮咚,您的'+k+'需支付'+str(dict[k])+'元')
else:
print('没货')
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