python sort dict keys by value in list code example Example: sort list of dictionaries by key python newlist = sorted(list_to_be_sorted, key=lambda k: k['name'])