第11071题 单选题
归并两个升序排列的选手得分数组的Python代码中,第9行横线处应填入哪项?

游戏大赛决赛两组选手得分已按从小到大排序,A组:[12, 35, 67, 89],B组:[20, 45, 55, 78],需合并为一个有序排行榜,现有归并合并核心代码如下:

A = [12, 35, 67, 89]
B = [20, 45, 55, 78]

i = 0
j = 0
result = []

while i < len(A) and j < len(B):
    ————————————————————————
    result.append(A[i])
    i += 1
else:
    result.append(B[j])
    j += 1

while i < len(A):
    result.append(A[i])
    i += 1

while j < len(B):
    result.append(B[j])
    j += 1

print("合并后的有序排行榜:", result)
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析