0

Let's say I have the following list.
foo = [["A", 1], ["B", 2], ["C", 1]]
I want to sort by the second element in the list, so I run the following.
foo.sort(key=lambda i: i[1])
Now, foo has the following order.
[['A', 1], ['C', 1], ['B', 2]]
Is there a good way to sort by the first eleme...