- 0
- 0
- 约5.5千字
- 约 17页
- 2026-10-12 发布于福建
- 举报
第PAGE页共NUMPAGES页
2026年计算机二级考试题库:Python编程语言应用
一、选择题(共15题,每题2分,共30分)
1.在Python中,用于定义类的方法必须包含的关键字是?
A.function
B.def
C.method
D.class
2.以下哪个不是Python内置的数据类型?
A.list
B.tuple
C.array
D.dictionary
3.在Python中,如何正确地注释一行代码?
A.//
B.#
C.//
D.
4.以下哪个选项是Python中的合法变量名?
A.2nd_year
B.-age
C.first_name
D.3times
5.在Python中,`if`语句后面必须跟什么符号?
A.:
B.;
C.{
D.
6.以下哪个方法用于向列表末尾添加一个元素?
A.append()
B.insert()
C.push()
D.add()
7.如何从字符串中提取子字符串world(假设原字符串为helloworld)?
A.helloworld[6:11]
B.helloworld[5:10]
C.helloworld[6:10]
D.以上都不对
8.在Python中,用于删除字典中指定键的函数是?
A.remove()
B.delet
原创力文档

文档评论(0)