sort a dictionary in python based on two keys code example
Example 1: python sorted dictionary multiple keys
mylist = sorted(mylist, key=itemgetter('name', 'age'))
mylist = sorted(mylist, key=lambda k: (k['name'].lower(), k['age']))
mylist = sorted(mylist, key=lambda k: (k['name'].lower(), -k['age']))
Example 2: python sort two key
s = sorted(s, key = lambda x: (x[1], x[2]))