编程测验考试题库及答案.docVIP

  • 3
  • 0
  • 约3.26千字
  • 约 13页
  • 2026-06-12 发布于湖南
  • 举报

编程测验考试题库及答案

一、单项选择题,(总共10题,每题2分)。

1.在Python中,用于定义一个函数的关键字是?

A.function

B.def

C.define

D.func

答案:B

2.下列哪个不是Python的基本数据类型?

A.int

B.float

C.string

D.boolean

答案:C

3.在Python中,如何正确地注释一行代码?

A.//Thisisacomment

B.Thisisacomment

C./Thisisacomment/

D.--Thisisacomment

答案:B

4.下列哪个是Python中的列表?

A.(1,2,3)

B.[1,2,3]

C.{1,2,3}

D.{1:a,2:b}

答案:B

5.在Python中,如何从字符串中提取子字符串?

A.string[start:end]

B.string[start:end:step]

C.string[start:end:step:stop]

D.string[start:stop]

答案:B

6.下列哪个是Python中的字典?

A.[1,2,3]

B.(1,2,3)

C.{1:a,2:b}

D.{1,2,3}

答案:C

7.在Python中,

文档评论(0)

1亿VIP精品文档

相关文档