Commit 9942f842 by BellCodeEditor

save project

parent 4b2c87f4
Showing with 9 additions and 3 deletions
# 直接运行以下代码,说说你的发现: # 直接运行以下代码,说说你的发现:
dict_hero={'猴三':10,'猴一':21,'猴五':22,'猴队长':29,'猴七':30} '''dict_hero={'猴三':10,'猴一':21,'猴五':22,'猴队长':29,'猴七':30}
print(dict_hero['猴一']) print(dict_hero['猴一'])
dict_hero['猴五']=50 dict_hero['猴五']=50
print(dict_hero['猴七']) print(dict_hero['猴七'])
...@@ -8,4 +8,10 @@ dict_hero['猴八']=17 ...@@ -8,4 +8,10 @@ dict_hero['猴八']=17
dict_hero['猴九']=99 dict_hero['猴九']=99
if "猴一" in dict_hero: if "猴一" in dict_hero:
dict_hero['猴一']=50 dict_hero['猴一']=50
print(dict_hero) print(dict_hero)'''
\ No newline at end of file dict={'可口可乐':3,'乐事':5,'饼干':9}
k=input('你想要啥')
if k in dict:
print('您的'+k+'需要支付'+str(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