- 1
- 0
- 约3.13千字
- 约 13页
- 2026-03-30 发布于辽宁
- 举报
2026年2道代码测试题及答案大全
一、单项选择题(总共10题,每题2分)
1.以下哪个不是Python的基本数据类型?
A.int
B.float
C.string
D.boolean
答案:D
2.在Python中,如何定义一个空列表?
A.[]
B.{}
C.()
D.
答案:A
3.以下哪个是Python中的注释符号?
A.//
B./
C.
D.//
答案:C
4.在Python中,如何获取字符串的长度?
A.len()
B.count()
C.length()
D.size()
答案:A
5.以下哪个是Python中的条件语句的关键字?
A.if
B.while
C.for
D.do
答案:A
6.在Python中,如何实现列表的排序?
A.sort()
B.ordered()
C.arrange()
D.sort_list()
答案:A
7.以下哪个是Python中的循环语句的关键字?
A.loop
B.repeat
C.while
D.for
答案:C
8.在Python中,如何打开一个文件进行读取?
A.open(file.txt,r)
B.open(file.txt,read)
C.file(file.txt,r)
D.read(file.txt)
答案:A
9.以下哪
原创力文档

文档评论(0)