If I have a list of tuples:
results = [(\'10\', \'Mary\'), (\'9\', \'John\'), (\'10\', \'George\'), (\'9\', \'Frank\'), (\'9\', \'Adam\')]
sort method accept optional key parameter.
key specifies a function of one argument that is used to extract a comparison key from each list element
You need to convert string to number:
>>> results = [('10', 'Mary'), ('9', 'John'), ('10', 'George'), ('9', 'Frank'), ('9', 'Adam')]
>>> results.sort(key=lambda x: (int(x[0]), x[1]), reverse=True)
>>> results
[('10', 'Mary'), ('10', 'George'), ('9', 'John'), ('9', 'Frank'), ('9', 'Adam')]