python考试题库及答案.docVIP

  • 4
  • 0
  • 约3.38千字
  • 约 8页
  • 2026-06-13 发布于江苏
  • 举报

python考试题库及答案

试题部分:

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

Python中,哪个关键字用于定义函数?

A.Function

B.Def

C.Func

D.Define

下列哪个不是Python的内置数据类型?

A.List

B.Dictionary

C.Array

D.Boolean

如何在Python中实现类的继承?

A.用extends关键字

B.用inherits关键字

C.用继承关键字

D.用class关键字后面跟继承的类名

Python中,如何读取文件内容?

A.open(filename)

B.read(filename)

C.file(filename)

D.open(filename).read()

下列哪个是Python中的迭代器?

A.List

B.Tuple

C.String

D.Alloftheabove

Python中,哪个方法用于向字典中添加键值对?

A.add()

B.append()

C.update()

D.insert()

如何在Python中创建一个空列表?

A.[]

B.{}

C.()

D.newlist()

Python中,哪个运算符用于取模?

A.//

B.%

C.*

D./

如何在Python中导入模块?

A.importmodule

B.in

文档评论(0)

1亿VIP精品文档

相关文档