- 1
- 0
- 约5.32千字
- 约 9页
- 2026-09-05 发布于山东
- 举报
移动考试题库2015
姓名:__________考号:__________
一、单选题(共10题)
1.在Python中,如何定义一个空字典?()
A.dict()
B.newdict()
C.dictionary()
D.{}
2.在Python中,如何将一个字符串中的所有小写字母转换为大写字母?()
A.str.upper()
B.string.upper()
C.str.toLowerCase()
D.string.toLowerCase()
3.在Python中,如何判断一个变量是否为列表类型?()
A.isinstance(variable,list)
B.type(variable)islist
C.variableislist
D.variable==list
4.在Python中,如何生成一个随机整数?()
A.random.randint(1,10)
B.random.random(1,10)
C.random.random(1,10)
D.random.random(1,10)
5.在Python中,如何将一个列表中的元素按照指定条件进行排序?()
A.list.sort(key=lambdax:x)
B.list.sort(key=x)
C.
原创力文档

文档评论(0)