1. 排序函数sorted()调用
student_tuples = [
('john', 'A', 15),
('jane', 'B', 12),
('dave', 'B', 10),
]
student_tuples_sorted = sorted(student_tuples, key=lambda student: student[2])
print student_tuples_sorted
效果
参考
https://www.cnblogs.com/koujiaodahan/p/8047109.html