2023年3月电子学会青少年软件编程(Python二级)等级考试试卷
客观题
二级
2023
2023-04-06 18:59:55
45次
2023年3月电子学会青少年软件编程(Python二级)等级考试试卷
客观题
二级
2023
2023-04-06 18:59:55
45次
一、单选题
14.
不能输出0~10之间所有奇数的程序是?()
A.a = 0 while a<10: if a%2 == 0: a = a + 1 continue print(a,end=' ') a = a + 1 |
B.for a in range(0,11): if a%2 != 1: continue print(a,end=' ') |
C.for a in range(0,11): if a%2 == 0: continue print(a,end=' ') |
D.a = 0 while a<10: if a%2 == 1: break a = a + 1 print(a) |
【知识点】 电子学会Python二级
21.
下列代码的执行结果是?()
mylist=['Failure','is','the','mother','of','success'] for x in mylist[:]: if len(x)<=3: mylist.append(x) print(mylist)
| A. ['Failure','is','the','mother','of','success'] |
B. ['Failure','is','the','mother','of','success','of','is'] |
| C. ['Failure', 'is', 'the', 'mother', 'of', 'success', 'is', 'of'] |
D. ['Failure', 'is', 'the', 'mother', 'of', 'success', 'is', 'the', 'of'] |
【知识点】 电子学会Python二级
