新疆移动笔试试题及答案.docxVIP

  • 2
  • 0
  • 约4.73千字
  • 约 8页
  • 2026-01-30 发布于河南
  • 举报

新疆移动笔试试题及答案

姓名:__________考号:__________

题号

总分

评分

一、单选题(共10题)

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

A.list=[1,2,3]

B.array=1,2,3

C.array=(1,2,3)

D.list=1,2,3

2.在Python中,以下哪个是正确的字符串操作?()

A.str=Hello+123

B.str=Hello-World

C.str=Hello*3

D.str=Hello/World

3.在Python中,如何删除字典中的键值对?()

A.deldict[key]

B.dict.remove(key)

C.dict.delete(key)

D.dict.pop(key,value)

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

A.list[-1]

B.list.last()

C.list.get(-1)

D.list.tail()

5.在Python中,以下哪个是正确的循环结构?()

A.whilei10:i++

B.doi10whilei++;

C.foriinrange(10)

D.foriinrange(10):i++

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

A.str(int)

B.str(int())

C.int(str)

D.str(int,str)

7.在Python中,如何判断一个变量是否为None?()

A.ifvarisNone

B.ifvar==None

C.ifvar!=None

D.ifvarisnotNone

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

A.deffunction():

B.functiondef():

C.func():

D.deffunc():

9.在Python中,如何使用异常处理?()

A.try:...except:...

B.try:...catch:...

C.try:...finally:...

D.try:...throw:...

10.在Python中,如何获取当前时间?()

A.importtime;current_time=time.get_time()

B.importdatetime;current_time=datetime.datetime.now()

C.importtime;current_time=time.current_time()

D.importdate;current_time=date.now()

二、多选题(共5题)

11.以下哪些是Python中的基本数据类型?()

A.整数

B.浮点数

C.字符串

D.列表

E.字典

F.元组

G.集合

12.以下哪些函数可以用来检查字符串是否包含子字符串?()

A.str.find(substring)

B.str.index(substring)

C.str.contains(substring)

D.str.count(substring)

13.以下哪些是Python中的条件语句关键字?()

A.if

B.else

C.elif

D.case

E.switch

14.以下哪些是Python中的循环语句关键字?()

A.for

B.while

C.do

D.foreach

E.loop

15.以下哪些是Python中的文件操作函数?()

A.open()

B.read()

C.write()

D.close()

E.seek()

三、填空题(共5题)

16.Python中,用于定义函数的关键字是______。

17.Python中,用于打印输出到控制台的关键字是______。

18.Python中,用于判断一个变量是否为空的关键字是______。

19.Python中,用于获取列表长度的内置函数是______。

20.Python中,用于将一个字符串转换为整数的关键字是______。

四、判断题(共5题)

21.在Python中,所有变量在使用前都必须先声明数据类型。()

A.正确B.错误

22.Python中的列表索引是从0开始的。()

A.正确

文档评论(0)

1亿VIP精品文档

相关文档