Write a python function that accepts a list of dictionaries and sorts it by a specified key


Topic: Write a python function that accepts a list of dictionaries and sorts it by a specified key

Solution

def sort_dict_list(dict_list, sort_key):
  dict_list.sort(key=lambda item: item.get(sort_key))



List all Python Programs