sort a dict of dicts python code example
Example 1: sort list of dictionaries by key python
newlist = sorted(list_to_be_sorted, key=lambda k: k['name'])
Example 2: how to sort a dictionary
markdict = {"Tom":67, "Tina": 54, "Akbar": 87, "Kane": 43, "Divya":73}
marklist = sorted(markdict.items(), key=lambda x:x[1])
sortdict = dict(marklist)
print(sortdict)