I have a list like this
[[x,y,1],[w,u,4],[m,n,3] ... [p,q,5]]
I need to sort the outer list by the third (last) element of the inner list, the
my_list.sort(key=lambda x: x[-1])
or
my_list.sort(key=operator.itemgetter(-1))
The second option is slightly faster.