PROBLEM SET
题库
按难度与知识点筛选,找到适合的练习题。
题目列表
共 67434 题
A22177
表达式{x**2 for x in range(-2,3)}的显示结果可能是? ( )
Python-L3
中等
--
A22178
在以下场景中,使⽤元组⽐使⽤列表更合适的是?( )
Python-L3
中等
--
A22179
执行(1,2)+(3,4)的结果是?( )
Python-L3
中等
--
A22180
对于字符串s ="Hello,Python",执行 s.find("Java")和s.index("Java")的结果分别是?( )
Python-L3
中等
--
A22181
关于字符串的不可变性,下列说法正确的是?( )
Python-L3
中等
--
A22182
合并两个字典d1={'a':1}和d2={'b':2}的正确方式是?( )
Python-L3
中等
--
A22183
分析以下代码段,最终的输出结果是什么?( )config = { debug': True, 'port':8080, 'debug': False, 'timeout': 30 } print(config['debug'])
Python-L3
中等
--
A22184
已知 lst=list(range(10)),即 [0,1,2,3,4,5,6,7,8,9]。要获取切片 [8,6,4,2],应该使用的切片操作是?( )
Python-L3
中等
--
A22185
Python表达式 [x % 3 for x in range(10) if x % 2 == 0] 的值是?( )
Python-L3
中等
--
A22186
执⾏下⾯Python代码后,输出的结果是?( )a=[1,2] b= a.copy() a[0] =3 print(b)
Python-L3
中等
--
A22187
在Python中,有⼀个整数变量x ,现需要将其⼆进制表⽰中的第三位(从右向左,最低位为第0位)设置为1,⽽其它位保持不变。下列哪段代码可以正确实现此功能?( )
Python-L3
中等
--
A22188
下⾯选项中最⼤的数是?( )
Python-L3
中等
--
A22193
以下程序中使用了递推方式计算阶乘(n!=1x2x...xn),计算结果正确。( )def factorial(n): res = 1 for i in range(n + 1): res *= i return res
Python-L4
较难
--
A22194
选择排序算法是不稳定的,⽽插⼊排序算法是稳定的。( )
Python-L4
较难
--
A22195
执行下面Python代码后,输出的结果为[0]。( )print(list(filter(None,[0,1,2, 3])))
Python-L4
较难
--
A22196
执行下面Python代码会抛出 TypeError异常。( )int("3.14")
Python-L4
较难
--
A22197
在Prthon中,readline()方法每次读取文件的下一行内容,包括行尾的换行符。如果已到文件末尾,则返回一个空字符串。( )
Python-L4
较难
--
A22198
执⾏以下Python代码后,输出结果是 True 。( )def func(lst=[]): lst.append(1) return lst print(func() is func())
Python-L4
较难
--
A22199
执⾏以下Python代码后,输出结果是 15 。( )def create_multiplier(n): return lambda x: x * n mult = create_multiplier(3) print(mult(5))
Python-L4
较难
--
A22200
使用解析式{x : y for x in range(2) for y in range(2)}可以创建一个包含4个键值对的字典。( )
Python-L4
较难
--