python sorted dictionary multiple keys

Solutions on MaxInterview for python sorted dictionary multiple keys by the best coders in the world

showing results for - "python sorted dictionary multiple keys"
Cristina
11 Jan 2020
1mylist = sorted(mylist, key=itemgetter('name', 'age'))
2mylist = sorted(mylist, key=lambda k: (k['name'].lower(), k['age']))
3mylist = sorted(mylist, key=lambda k: (k['name'].lower(), -k['age']))
4