第26026题 判断题
判断"执行给定两段Python代码输出结果相同"的表述是否正确

执行下列两段Python代码,输出的结果相同。

lst = [0, 1, 2, 3, 4, 5, 5, 3, 1]
a = []
for item in lst:
    if item not in a:
        a.append(item)
print(sorted(a))

lst = [0, 1, 2, 3, 4, 5, 5, 3, 1]
a = sorted(list(set(lst)))
print(a)
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析