Commit 5fa32a69 by BellCodeEditor

save project

parent 7a62adbf
Showing with 7 additions and 11 deletions
# 直接运行以下代码,说说你的发现: dict={"可乐":3,"雪碧":4,"薯片":5,"薯条":6,"果汁":7}
list_hero=['语文',440,'数学',370,'英语',520,'历史',890,'政治',980] k=input("你想买什么?")
dict_hero = {'语文':440,'数学':370,'英语':520,'历史':890,'政治':980} if k in dict:
print(len(list_hero)) print("你购买的商品是"+k+"你需要支付"+str(dict[k]))
print(len(dict_hero)) else:
dict_hero["语文"]=200 print("不好意思我们没有这个商品")
print(dict_hero) \ No newline at end of file
dict_hero["化学"]=760
if "生物" in dict_hero:
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