There is a list:
[(2, 'hi'), (1, 'what'), (3, 'is'), (1, 'your'), (3, 'name'), (2, 'my'), (2, 'bond'), (1, 'james'), (4, 'damme'), (3, 'van'), (2, 'claude'), (1, 'jean')] You need to sort it by value, but if the value matches, then alphabetically. As far as I understand it is necessary to transfer a certain lambda-function to the key , but I do not know how to implement it.