PROBLEM SET
题库
按难度与知识点筛选,找到适合的练习题。
题目列表
共 67434 题
A31982
执行下面Python代码后,输出两个True。print("h" in "hello")print("he" in "hello")
Python-L4
较难
--
A31984
GESP测试是对认证者的编程能力进行等级认证,同一级别的能力基本上与编程语会无关。( )
Python-L4
中等
--
A31985
执行下面Python代码,输入0和字符串“abc”后,输出的结果是?( )try: a = int(input()) b = int(input()) x = a / b print(x, end="#")except ZeroDivisionError: print(0, end="#")except: print(1, end="#") else: print(2, end="#") fin…
Python-L4
较难
--
A31986
执行下面Python代码后,⽂件ip.txt中的内容用记事本打开时显示为?( )with open("ip.txt", "w") as f: lst = ["202.206.224.21\n", "192.168.224.1\n"] f.writelines(lst)
Python-L4
较难
--
A31987
执行下面Python代码后,输出的结果是?( )lst = [1, 4, 3, 5, 2]lst = [i[0] for i in sorted(enumerate(lst), key=lambda x: x[1])]print(lst)
Python-L4
较难
--
A31988
执行下面Python代码后,输出的结果是?( )users = [{"name": "Tom", "skills": {"Python", "Java", "C++"}},{"name": "Join", "skills": {"Python", "Java"}},{"name": "Gaia", "skills": {"Java", "C++", "SQL"}}]skills_sets = (…
Python-L4
较难
--
A31989
程序段如下:def fun(arr: list): n = len(arr) for i in range(n - 1): for j in range(0, n - i - 1): if arr[j] > arr[j + 1]: arr[j], arr[j + 1] = arr[j + 1], arr[j]其中,n为正整数,则该段程序的最坏时间复杂度是?( )
Python-L4
较难
--
A31990
在一个农场上,有一头母牛。根据农场的规则,这头母牛每年年初都会生出一头小母牛。每头新生的小母牛从它们出生的第四个年头开始,也会每年年初生出一头新的小母牛。假设没有母牛死亡,并且每头母牛都严格遵 循这个规则。下列程序用来计算在第 n(n≤30) 年时,农场上共有多少头母牛,其中横线处填写的代码为?( )lst = [0] * 100lst[1:4] = [1, 2, 3, 4]def calcul…
Python-L4
较难
--
A31991
执行下面python代码后,输出的结果是?( )def add(c): d = c.append(40) return da = [10, 20, 30]b = add(a) print(a, b)
Python-L4
较难
--
A31992
执行下面python代码后,输出的结果是?( )s = 1def sums(n): global s s = 0 s = s + n print(s, end="#")sums(5)print(s, end="#")
Python-L4
较难
--
A31993
执行下面python代码后,输出的结果是?( )def add(): count = 1 def fun(): nonlocal count print(count, end="#") count += 2 return fun a = add()a()a()
Python-L4
较难
--
A31994
执行下面Python代码后,输出的结果是?( )def fun(x, y, **kwargs): res = x + y for i in kwargs.values(): res += i return resprint(fun(10, 20, A=6, B=1, C=3))
Python-L4
较难
--
A31995
执行下面Python代码后,输出的结果是?( )def fun(x, y, *nums): res = x + y for i in nums: res += i return resprint(fun(10, 20, 15, 25, 30))
Python-L4
较难
--
A31996
函数fun的定义如下,调用该函数的语句错误的是?( )def fun(x, y, z=3): print(x, y, z)
Python-L4
较难
--
A31997
执行下面Python代码后,输出的结果可能是?( )name = ('Tom', 'Join', 'Gaia')age = (10, 13, 12)print({(a.upper(), b) for a, b in zip(name, age)})
Python-L4
较难
--
A31998
下面流程图在yr输入2024时,可以判定yr代表闰年,并输出 2月是29天 ,则图中菱形框中应该填入( )。
Python-L4
较难
--
A31999
小杨父母带他到某培训机构给他报名参加CCF组织的GESP认证考试的第1级,那他可以选择的认证语会有几种?( )
Python-L4
较难
--
A32000
寻找倍数
Python-L3
中等
--
A32001
移位题面描述小杨学习了加密技术移位,所有大写字母都向后按照一个固定数目进行偏移。偏移过程会将字母表视作⾸尾相接的 环,例如,当偏移量是3的时候,大写字母 A 会替换成 D,大写字母 Z 会替换成 C,总体来看,大写字母表 ABCDEFGHIJKLMNOPQRSTUVWXYZ 会被替换成 DEFGHIJKLMNOPQRSTUVWXYZABC。注:当偏移量是26的倍数时,每个大写字母经过偏移后会恰好…
Python-L3
中等
--
A32002
把整数3025从中剪开分为30和25两个数,此时再将这两数之和平方,计算结果⼜等于原数。(30 + 25) × (30+ 25) = 55 × 55 = 3025,这样的数叫“雷劈数”。可以使用枚举的方法求出所有符合这样条件的四位数。( )
Python-L3
中等
--