[{'x': 4, 'y': 1}, {'x': 2, 'y': 3}]
TED 发表于 2017-12-27 01:10
points是一个列表,points.sort(key=...)是对这个列表通过key来排序,
lambda i : i['y']可以看作:
def g( ...
TED 发表于 2017-12-28 09:45
1. 由sort所用的排序算法决定的,可以参考下https://github.com/qiwsir/algorithm/blob/master/python_so ...
欢迎光临 Crossin的编程教室 (https://bbs.crossincode.com/) | Powered by Discuz! X2.5 |