- 0
- 0
- 约3.83千字
- 约 12页
- 2026-07-10 发布于福建
- 举报
第PAGE页共NUMPAGES页
2026年计算机编程基础语言Python试题库及答案解析
一、选择题(每题2分,共20题)
说明:下列每题只有一个正确答案。
1.在Python中,以下哪个语句是正确的?
A.`if(x5):`
B.`ifx5:`
C.`ifx5then:`
D.`ifx5do:`
2.以下哪个不是Python的内置数据类型?
A.`list`
B.`dictionary`
C.`array`
D.`tuple`
3.如何在Python中反转字符串`hello`?
A.`hello[::-1]`
B.`reverse(hello)`
C.`list(hello)[::-1]`
D.`sorted(hello,reverse=True)`
4.以下哪个函数用于计算列表中元素的总和?
A.`min()`
B.`sum()`
C.`max()`
D.`avg()`
5.在Python中,如何定义一个函数?
A.`functionmyfunc():`
B.`defmyfunc():`
C.`funcmyfunc():`
D.`voidmyfunc():`
6.以下哪个是Python中的异常处理关键字?
A.`catch`
B.`try-except`
C.`err
原创力文档

文档评论(0)