📜  排序第一个元素反向排序第二个python代码示例

📅  最后修改于: 2022-03-11 14:45:37.792000             🧑  作者: Mango

代码示例1
>>> sorted(lista, key=lambda x: (-x[0], x[1]))
[(485, 'Elizabeth'), (485, 'Matthew'), (390, 'Jayden'), (207, 'Natalie'), (144, 'Chloe'), (51, 'Elijah')]