- 0
- 0
- 约5.15千字
- 约 8页
- 2026-07-27 发布于宁夏
- 举报
考试题真题及答案
考试题真题及答案
考试题真题及答案
姓名:__________考号:__________
一、单选题(共10题)
1.下列哪个选项是Python中的基本数据类型?()
A.类
B.函数
C.字符串
D.列表
2.在Python中,如何定义一个空字典?()
A.my_dict={}
B.my_dict=dict()
C.my_dict=dict([])
D.my_dict=new_dict()
3.在Python中,如何获取一个列表的长度?()
A.len(list)
B.list.length
C.list.size
D.list.count
4.在Python中,如何遍历一个字典的键值对?()
A.forkeyindict:
B.forkey,valueindict.items():
C.forkey,valueindict:
D.forkey,valueindict.keys():
5.在Python中,如何将字符串转换为整数?()
A.int(str)
B.str(int)
C.int(str())
D.str(int(str))
6.在Python中,如何定义一个类?()
A.classMyClass:
B
原创力文档

文档评论(0)