第27175题 单选题
以下关于Python二维列表排序的代码中,哪一段可以将二维列表scores按学生成绩从高到低正确排序?

已知二维列表scores = [["Zhang", 82], ["Wang", 95], ["Li", 78], ["Zhao", 9]],需要将其按学生的考试成绩从高到低排列,下列选项中的代码可以实现该需求的是?

A

sorted(scores, key=lambda x: x[1], reverse=True)

B

sorted(scores, key=lambda x: x[])

C

scores.sort(key=lambda x: x[])

D

sorted(scores, reverse=True)

程序运行统计
暂无判题统计
提交0次 正确率0.00%
答案解析