- 取value最大的字典
In [1]: a = {'teacher_id': 234234, 'count': 20}
In [2]: b = {'teacher_id': 23443454, 'count': 30}
In [3]: c = {'teacher_id': 4533454, 'count': 70}
In [5]: max([a, b, c], key=lambda x: x['count'])
Out[5]: {'count': 70, 'teacher_id': 4533454}
- 排序列表或元组中某个值
In [6]: a = (234234, 20)
In [7]: b = (23445345, 30)
In [8]: c = (345, 70)
In [9]: max([a, b, c], key=lambda x: x[1])
Out[9]: (345, 70)