编程条件判断试题及答案.docxVIP

  • 0
  • 0
  • 约5.17千字
  • 约 9页
  • 2026-02-27 发布于河南
  • 举报

编程条件判断试题及答案

姓名:__________考号:__________

题号

一

二

三

四

五

总分

评分

一、单选题(共10题)

1.以下哪个是Python中的条件语句?()

A.while

B.if

C.for

D.def

2.在Python中,如何定义一个列表?()

A.list=[1,2,3]

B.array=(1,2,3)

C.set={1,2,3}

D.tuple=(1,2,3)

3.以下哪个是Python中的无限循环?()

A.whileTrue:

B.foriinrange(5):

C.ifi5:

D.whilei5

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

A.len(string)

B.size(string)

C.length(string)

D.string.size()

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

A.list

B.tuple

C.dict

D.set

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

A.int(string)

B.convert(string)

C.toint(string)

D.string.int()

7.以下哪个是Python中的列

文档评论(0)

1亿VIP精品文档

相关文档