2022.03全国青少年软件编程(Python)等级考试试卷(二级).docxVIP

  • 1
  • 0
  • 约1.5千字
  • 约 5页
  • 2023-12-28 发布于浙江
  • 举报

2022.03全国青少年软件编程(Python)等级考试试卷(二级).docx

2022.03全国青少年软件编程(Python)等级考试试卷(二级)

2022年03月全国青少年软件编程(Python)等级考试试卷(二级)

一、单项选择题(共30题,每题2分,共60分)

1.写出以下代码的输出结果:

```

x=1

deffunc():

globalx

y=1

x+=1

print(x,end=)

print(y,end=)

func()

x+=1

print(x)

```

A.213

B.113

C.212

D.112

答案:A.213

2.下面哪个选项是合法的Python标识符?

A.123abc

B.my_variable

C.2nd

D.$money

答案:B.my_variable

3.下面哪个选项是Python的关键字?

A.for

B.while

C.if

D.Alloftheabove

答案:D.Alloftheabove

4.下列哪个Python数据结构是有序的?

A.字典(dictionary)

B.列表(list)

C.元组(tuple)

D.集合(set)

答案:C.元组(tuple)

5.下面代码的输出是什么?

```

print(l

文档评论(0)

1亿VIP精品文档

相关文档