计算机二级python题库及答案.docxVIP

  • 0
  • 0
  • 约4.69千字
  • 约 8页
  • 2026-08-15 发布于中国
  • 举报

计算机二级python题库及答案

计算机二级python题库及答案

计算机二级python题库及答案

姓名:__________考号:__________

一、单选题(共10题)

1.Python中,下列哪个不是内置的数据类型?()

A.int

B.float

C.list

D.class

2.在Python中,如何将字符串hello转换为整数100?()

A.int(hello)

B.float(hello)

C.str(100)

D.str(100)

3.以下哪个是Python中的列表推导式?()

A.[xforxinrange(5)]

B.{xforxinrange(5)}

C.(xforxinrange(5))

D.xforxinrange(5)

4.在Python中,如何获取列表中最后一个元素的值?()

A.list[-1]

B.list[-2]

C.list[-3]

D.list[-4]

5.在Python中,如何定义一个函数?()

A.deffunc():

B.functionfunc():

C.func():

D.def(func):

6.在Python中,以下哪个是条件表达式(三元运算符)的正确写法?()

A.ifxy:

文档评论(0)

1亿VIP精品文档

相关文档