I have a nested list of pairs of numbers:
>>> l = [[0, 0], [1, 3], [3, 2], [3, 4], [4, 6], [5, 2], [3, 1], [1, 6], [5, 4], [4, 3], [2, 5], [3, 0]]
Is it possible to sort the list by the second term and then the first without using packages? The desired output is this:
>>> sort_two_then_one(l)
[[0, 0], [3, 0], [3, 1], [3, 2], [5, 2], [1, 3], [4, 3], [3, 4], [5, 4], [2, 5], [1, 6], [4, 6]]