2026python笔试题及答案.docVIP

  • 1
  • 0
  • 约2.82千字
  • 约 9页
  • 2026-10-19 发布于广东
  • 举报

2026python笔试题及答案

单项选择题(每题2分,共10题)

1.Python中用于创建列表的符号是()

A.{}

B.[]

C.()

D.

2.以下哪个是Python中的布尔值()

A.True

B.1

C.True

D.0

3.若a=[1,2,3],b=a,执行b.append(4)后,a的值是()

A.[1,2,3]

B.[1,2,3,4]

C.[4]

D.报错

4.以下能正确定义函数的是()

A.deffunc:

B.functionfunc():

C.deffunc():

D.func()

5.Python中,对字符串hello取前3个字符的操作是()

A.hello[0:3]

B.hello(0:3)

C.hello[1:3]

D.hello(1:3)

6.以下哪种方式不能用于打开文件()

A.open(file.txt,r)

B.open(file.txt,w)

C.open(file.txt,rw)

D.open(file.txt,a)

7.若x=5,y=2,x%y的结果是()

A.2

B.1

C.2.5

D.0

8.Python中,集合的特点是()

A.元素无序且唯

文档评论(0)

1亿VIP精品文档

相关文档