Commit ecc49cd1 by BellCodeEditor

save project

parent 92545ace
Showing with 8 additions and 5 deletions
# 直接运行以下代码,说说你的发现:
dict_hero = {'赵一':30,'丁二':37,'孙五':52,'王猛':89,'周亮':98}
dict_hero["赵一"]=35
dict_hero["赵三"]=50
print(dict_hero)
\ No newline at end of file
dict= {'可口可乐':30,'面包':37,'农夫山泉':52,'果冻':89,'巧克力':98}
dict["奥利给"]=1000
j=input("你要买什么?")
if j in dict:
print("您购买的"+j+"需要支付"+str(dict[j])+"元")
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