From 28ae3a84c85e29266a817972474dcc20f89f029f Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sat, 8 Jun 2024 20:07:38 +0800 Subject: [PATCH] save project --- quiz.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/quiz.py b/quiz.py index 85aa09a..a213fb3 100644 --- a/quiz.py +++ b/quiz.py @@ -1,5 +1,6 @@ -# 直接运行以下代码,说说你的发现: -list_hero=['赵一',30,'丁二',37,'孙五',52,'王猛',89,'周亮',98] -dict_hero = {'赵一':30,'丁二':37,'孙五':52,'王猛':89,'周亮':98} -print(len(list_hero)) -print(len(dict_hero)) \ No newline at end of file +tict={'可口可乐':3 '旺仔牛奶':4 '农夫山泉':1' 辣条':3' 巴西烤肉'2' 果冻':4 '乐事':5 '奥利奥':10 '巧克力':6 +k=input('你想买什么呀') +if k in dict: + print('叮咚~您的'+k+需要支付'+str(dict[k]+'元~') +else: + print('神奇百货暂未有您想要的物品,敬请期待') \ No newline at end of file -- libgit2 0.25.0