input: Write a function to sort a list of dictionaries by a specific key in each dictionary. The function should take two parameters: the list of dictionaries and the key to sort by. It should return the sorted list.
  
  Input:
  my_list = [{'name': 'Tom', 'age': 25}, {'name': 'John', 'age': 21}, {'name': 'Adam', 'age': 26}]
  key = 'age'
  
  Output:
  def sort_list_of_dicts_by_key(my_list, key):
      return sorted(my_list, key=lambda k: k[key])
  
  assert sort_list_of_dicts_by_key([{'name': 'Tom', 'age': 25}, {'name': 'John', 'age': 21}, {'name': 'Adam', 'age': 26}], 'age') == [{'name': 'John', 'age': 21}, {'name': 'Tom', 'age': 25}, {'name': 'Adam', 'age': 26}]
  assert sort_list_of_dicts_by_key([{'name': 'Tom', 'age': 25}, {'name': 'John', 'age': 21}, {'name': 'Adam', 'age': 26}], 'name') == [{'name': 'Adam', 'age': 26}, {'name': 'John', 'age': 21}, {'name': 'Tom', 'age': 25}]
output: def sort_list_of_dicts_by_key(my_list, key):
      return sorted(my_list, key=lambda k: k[key])