2026年计算机二级考试编程语言与应用技术题.docxVIP

  • 1
  • 0
  • 约3.97千字
  • 约 12页
  • 2026-07-22 发布于福建
  • 举报

2026年计算机二级考试编程语言与应用技术题.docx

第PAGE页共NUMPAGES页

2026年计算机二级考试编程语言与应用技术题

一、选择题(共10题,每题2分,合计20分)

要求:下列每小题均只有一个正确答案。

1.在Python中,以下哪个语句可以正确打开并读取名为“data.txt”的文件?

A.`open(data.txt,r)`

B.`file=open(data.txt,r)`

C.`withopen(data.txt,r)asfile:`

D.`read(data.txt)`

2.以下哪个模块常用于处理正则表达式?

A.`math`

B.`datetime`

C.`re`

D.`json`

3.在Python中,如何定义一个类并创建其实例?

A.`classPerson;Personp=newPerson()`

B.`classPerson:pass;p=Person()`

C.`defPerson():pass;p=Person()`

D.`classPerson:def__init__():pass;p=Person()`

4.以下哪个函数可用于获取当前系统时间?

A.`time.now()`

B.`datetime.datetime.now()`

C.`sys.time()`

D.`ran

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档