编程测验考试题及答案.docxVIP

  • 1
  • 0
  • 约4.82千字
  • 约 9页
  • 2026-08-16 发布于中国
  • 举报

编程测验考试题及答案

编程测验考试题及答案

编程测验考试题及答案

姓名:__________考号:__________

一、单选题(共10题)

1.以下哪个是Python中的布尔值类型?()

A.int

B.float

C.bool

D.str

2.在Python中,以下哪个是列表推导式的正确写法?()

A.foriinrange(5):list.append(i)

B.[iforiinrange(5)]

C.list=[foriinrange(5):i]

D.list=(iforiinrange(5))

3.以下哪个是Python中的元组类型?()

A.list

B.tuple

C.dict

D.set

4.在Python中,如何获取字符串的长度?()

A.length(str)

B.len(str)

C.str.length()

D.str.size()

5.以下哪个是Python中的字典类型?()

A.list

B.tuple

C.dict

D.set

6.在Python中,以下哪个是函数定义的正确方式?()

A.deffunction():

B.function():

C.function=()

D.deffuncti

文档评论(0)

1亿VIP精品文档

相关文档