- 0
- 0
- 约6.55千字
- 约 20页
- 2026-08-26 发布于福建
- 举报
第PAGE页共NUMPAGES页
2026年计算机编程语言Python中级认证考试题
一、单选题(每题2分,共20题)
1.在Python中,以下哪个语句可以正确打开并读取名为“data.txt”的文件?
A.`open(data.txt)`
B.`open(data.txt,r)`
C.`file=open(data.txt)`
D.`withopen(data.txt)asf:`
2.以下哪个Python函数用于将字符串转换为列表?
A.`split()`
B.`join()`
C.`convert()`
D.`to_list()`
3.在Python中,如何定义一个类并创建其实例?
A.`classMyClass:pass;obj=MyClass()`
B.`defMyClass():pass;obj=MyClass()`
C.`MyClass=class:pass;obj=MyClass()`
D.`classMyClass:pass;instance=MyClass()`
4.以下哪个装饰器可以实现函数运行时间的统计?
A.`@time()`
B.`@stopwatch()`
C.`@measure_time()`
D.`@timer()`
5.在Python中,
原创力文档

文档评论(0)