2019/9/203-17选择题-慕课网就业班https://class.imooc.com/lesson/917#mid=242221/11.单选题编写代码,使得输出{'season1':'春天','season2':'夏天','season3':'秋天','season4':'冬天'},下列代码编写正确的是()(选一项)正确答案:B你的答案:B参考解析:本题考查的是对字典生成式的运用,A选项i是从0开始的想要得到season1,i应+项range()数字序列lst是个列表,根据题意应为列表的长度即len(lst),D选项s个字符串应加单引号或者双引号,所以B选项正确。您答对了lst=['春天','夏天','秋天','冬天']dict1={'season'+str(i):lst[i]foriinrange(0,len(lst))}print(dict1)Alst=['春天','夏天','秋天','冬天']dict1={'season'+str(i+1):lst[i]foriinrange(0,len(lst))}print(dict1)Blst=['春天','夏天','秋天','冬天']dict1={'season'+str(i+1):lst[i]foriinrange(0,lst)}print(dict1)Clst=['春天','夏天','秋天','冬天']dict1={season+str(i+1):lst[i]foriinrange(0,len(lst))}print(dict1)D重做3-17选择题1章节问答笔记资料/Python零基础入门/步骤一·3-17选择练习