Python - sort wrt second argument
Question: I have a list, which I wish to sort. List is made of items with two elements
each. I wish to sort wrt to second element only. Thus, I am almost sure that

    
    
    L = [[4,2],[5,2]]
    sorted(L)
    

won't do the job.

How to proceed? I come through answers but did not understand what could apply
to problem.

Thansk!


Answer: 
    from operator import itemgetter
    sorted(L, key=itemgetter(1))
    

Returns the sorted list `L`, sorted by `key` the second item in each element
of `L`.

