Commit 5fa32a69 by BellCodeEditor

save project

parent 7a62adbf
Showing with 7 additions and 11 deletions
# 直接运行以下代码,说说你的发现:
list_hero=['语文',440,'数学',370,'英语',520,'历史',890,'政治',980]
dict_hero = {'语文':440,'数学':370,'英语':520,'历史':890,'政治':980}
print(len(list_hero))
print(len(dict_hero))
dict_hero["语文"]=200
print(dict_hero)
dict_hero["化学"]=760
if "生物" in dict_hero:
print("生物")
\ No newline at end of file
dict={"可乐":3,"雪碧":4,"薯片":5,"薯条":6,"果汁":7}
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