计算机二级Python语言程序设计模拟考试题.docxVIP

  • 1
  • 0
  • 约4.49千字
  • 约 11页
  • 2026-03-19 发布于广西
  • 举报

计算机二级Python语言程序设计模拟考试题.docx

计算机二级Python语言程序设计模拟考试题

考试时间:120分钟?总分:100分?年级/班级:__________

试标题是:“计算机二级Python语言程序设计模拟考试题”

一、选择题

1.在Python中,下列哪个语句是正确的?

A.if(xy):print(xisgreaterthany)

B.ifxythen:print(xisgreaterthany)

C.ifxy:print(xisgreaterthany)

D.ifxy;print(xisgreaterthany)

2.下列哪个不是Python的保留字?

A.def

B.class

C.int

D.array

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

A.[]

B.()

C.{}

D.

4.下列哪个方法用于向列表末尾添加一个元素?

A.insert()

B.append()

C.extend()

D.delete()

5.下列哪个函数用于返回字符串的长度?

A.len()

B.count()

C.find()

D.index()

6.在Python中,如何定义一个函数?

A.functionmy_function():

B.defmy_function():

C.func

文档评论(0)

1亿VIP精品文档

相关文档