Sorting
-
Sorting
listoflistsarr = [[1,3],[2,6],[8,10],[15,18]] arr.sort(key=lambda x: x[0])This sorts
arrusing the first value of the child lists as the key to compare
Sorting list of lists
arr = [[1,3],[2,6],[8,10],[15,18]]
arr.sort(key=lambda x: x[0])
This sorts arr using the first value of the child lists as the key to compare