4
If I have a list of lists like this:
lista = [['ana','1'], ['joao', '3'], ['rita','2'], ['alice','2']]
I first want to sort the list according to the numbers, to look like this:
lista = [['ana','1'], ['rita','2'], ['alice','2'], ['joao', '3']]
That I did with: listaOrdenada = sorted(lista, key = lambda x: x[1])
But since in this case I have two lists with the number '2', I want to sort these two lists alphabetically according to the name, how do I do this?
Related: http://answall.com/questions/101159/ordernar-listers
– Jéf Bueno