题目编号
语言
全部语言
等级
全部等级
考查知识点
选择考查知识点 (0)
找到 1505 道单选题
EXY-SC-2895
第 81 题
学校举行编程比赛,共有 M 个班级参加,总计 N 名学生提交了作品。每份作品有一个班级编号(1 到 M )和得分。现需要统计每个班级的最高得分,并计算所有班级最高得分的总和。分数为非负数。以下程序试图实现此功能,横线处应填写的代码是?( )
M, N = map(int, input().split())
max_score = [0] * (M + 1)
for _ in range(N):
    cls, score = map(int, input().split())
    _____①_____
        max_score[cls] = score
_____②_____
print(total)
A
① if score > max_score[cls]: ,② total = sum(max_score[0:M])
B
① if score < max_score[cls]: ,② total = sum(max_score[1:])
C
① if score > max_score[cls]: ,② total = sum(max_score[1:])
D
① if score >= max_score[cls]: ,② total = sum(scores)
语言: Python
GESP真题 三级
2026.9
单选题号: 15
EXY-SC-2894
第 82 题
以下 Python 代码的功能是?( )
s = input("请输入字符串:")
words = s.split()
longest_word = ""
for word in words:
    if len(word) > len(longest_word):
        longest_word = word
print(longest_word)
A
找出字符串中出现次数最多的单词
B
找出字符串中长度最大的单词,若有多个则全部输出
C
找出字符串中最后一个出现的长度最大的单词
D
找出字符串中第一个出现的长度最大的单词
语言: Python
GESP真题 三级
2026.9
单选题号: 14
EXY-SC-2893
第 83 题
笔记本 5 元/本,笔 3 元/支,橡皮 1 元/个,用 100 元买 50 件文具。以下程序枚举所有购买方案,横线处应填写的代码是?( )
for notebook in range(0, 21):
    for pen in range(0, 34):
        for eraser in range(0, 51):
            if ________:
                print(notebook, pen, eraser)
A
notebook + pen + eraser == 50 and notebook*5 + pen*3 + eraser*1 == 100
B
notebook + pen + eraser == 50
C
notebook*5 + pen*3 + eraser*1 == 100
D
notebook*5 + pen*3 + eraser*1 <= 100
语言: Python
GESP真题 三级
2026.9
单选题号: 13
EXY-SC-2892
第 84 题
执行下面 Python 代码后,输出的结果是?( )
my_tuple = (1, 2, 3)
my_list = list(my_tuple)
my_list.append(4)
new_tuple = tuple(my_list)
print(new_tuple)
A
(1, 2, 3)
B
(1, 2, 3, 4)
C
[1, 2, 3, 4]
D
代码会报错,因为元组不可修改
语言: Python
GESP真题 三级
2026.9
单选题号: 12
EXY-SC-2891
第 85 题
在 Python 中,表达式 {x % 3 for x in range(6)} 的结果是?( )
A
{0, 1, 2, 3}
B
{0, 1, 2}
C
{0, 1}
D
{3}
语言: Python
GESP真题 三级
2026.9
单选题号: 11
当前页显示 81 - 85 ,共 1505 道单选题