students=[
{"sno":245,"sname":"小李","sgrade":98},
{"sno":252,"sname":"小林","sgrade":77},
{"sno":203,"sname":"小青","sgrade":89},
{"sno":204,"sname":"小吴","sgrade":76}]
students_sort=sorted(students,key=lambda x:x["sgrade"],reverse=True)
print("排序前:")
print(students)
print("排序后:")
print(students_sort)
成绩的排序
最新推荐文章于 2024-11-11 21:19:25 发布