⬅︎ Back to In Python you sort with a tuple
also if you want to reverse the whole thing, there is a 'reverse' parameter in sorted:sorted(peeps, key=lambda x: (x['name'], x['salary']), reverse=True)and BTW did i mention that i love python for things like this?
Comment
also if you want to reverse the whole thing, there is a 'reverse' parameter in sorted:
sorted(peeps, key=lambda x: (x['name'], x['salary']), reverse=True)
and BTW did i mention that i love python for things like this?