Is there a quick and easy way to sort a list of tuples containing two items? (a short list of the tuples I am trying to sort:
[('this', 4), ('in', 4), ('dedicated', 4), ('who', 3), ('us', 3), ('they', 3), ('so', 3), ('shall', 3), ('people', 3), ('is', 3), ('great', 3), ('dead', 3), ('are', 3), ('It', 3), ('which', 2), ('what', 2)]
I am trying to sort them first by frequency (largest first), so the number, and then by alphabetical order.
This is what I have so far:
word_list.sort(key=itemgetter(1,0), reverse = True)
This sorts the list by frequency in descending order.