Commit 473ba897 by BellCodeEditor

save project

parent 98f5036b
Showing with 2 additions and 5 deletions
...@@ -11,5 +11,4 @@ ...@@ -11,5 +11,4 @@
# 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典 # 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典
dict_hero={"张四":2,"李三":1} dict_hero={"张四":2,"李三":1}
dict_hero["李三"]=10 dict_hero["李三"]=10
dict_hero["王二"]=0.5
print(dict_hero) print(dict_hero)
dict={"一":3,"二":4,"三":5,"四":6,"果汁":7} dict={"一":3,"二":4,"三":5,"四":6,"果汁":7}
k=input("你想买什么?") k=input("你想买什么?")
if k in dict: if k in dict:
print("你购买的商品是"+k+"你需要支付"+str(dict[k])) print("您购买的商品是"+k+"需要"+str(k))
else: \ No newline at end of file
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