Commit ed57340c by BellCodeEditor

save project

parent 65094279
Showing with 10 additions and 7 deletions
...@@ -11,10 +11,13 @@ ...@@ -11,10 +11,13 @@
# 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典 # 请注释掉上面的代码,并在下一行创建一个名为dict_hero的字典
# dict_shop={"马":30,"牛":20,"鸡":5,"鱼":10} # dict_shop={"马":30,"牛":20,"鸡":5,"鱼":10}
# print(dict_shop) # print(dict_shop)
dict_monkeys={'猴三':10,'猴一':21,'猴五':22,'猴队长':29,'猴七':30} dict_robotshop={'老八的shit':35,'巴西草肉':30,'小鸟伏特加':3000000000000,'毛主席茅台':100000000000000000}
print(monkeys['猴队长']) print(dict_robotshop)
dict_monkeys['猴七']=32 while True:
print(dict_monkeys) shop=input("欢迎光临,请问你需要什么?")
if '猴十' not in dict_monkeys: if shop in dict_robotshop:
dict_monkeys['猴十']=25 many=int(input("How many do you want?"))
print(dict_monkeys) money=many*dict_robotshop[shop]
print("您购买的"+str(many)+"个"+shop+"一共需要"+str(money)+"元~")
else:
print("抱歉,暂时缺货哦,亲~")
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