How can I sort a list by a key described by an arbitrary function? For example, if I have:
mylist = [["quux", 1, "a"], ["bar", 0, "b"]]
I'd like to sort "mylist" by the second element of each member, e.g.
sort(mylist, key=lambda x: x[1])
how can I do this?
thanks.