<gh_stars>1-10
# -*- coding:utf8 -*-
# Power by zuosc 2016-10-13
# 排序算法

from operator import itemgetter
students = [('Bob', 75), ('Adam', 92), ('Bart', 66), ('Lisa', 88)]

print(sorted(students, key=itemgetter(0)))
print(sorted(students, key=lambda t: t[1]))
print(sorted(students, key=itemgetter(1), reverse=True))

# -*- coding:utf8 -*-
# Power by zuosc 2016-10-13
# 排序算法

from operator import itemgetter
students = [('Bob', 75), ('Adam', 92), ('Bart', 66), ('Lisa', 88)]

print(sorted(students, key=itemgetter(0)))
print(sorted(students, key=lambda t: t[1]))
print(sorted(students, key=itemgetter(1), reverse=True))
# -*- coding:utf8 -*- # Power by zuosc 2016-10-13 # 排序算法