input: Write a function to sort a list of dictionaries by a specific key in each dictionary. The function should take two parameters: the first one being the list of dictionaries and the second one being the key by which the list should be sorted. Use the sorted() function with a lambda expression to achieve this.
  
  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}]
  assert sort_list_of_dicts_by_key([{'x': 10, 'y': 30}, {'x': 5, 'y': 15}, {'x': 20, 'y': 20}], 'x')==[{'x': 5, 'y': 15}, {'x': 10, 'y': 30}, {'x': 20, 'y': 20}]
  assert sort_list_of_dicts_by_key([{'a': 5, 'b': 7}, {'a': 8, 'b': 2}, {'a': 3, 'b': 9}], 'b')==[{'a': 8, 'b': 2}, {'a': 5, 'b': 7}, {'a': 3, 'b': 9}]
  assert sort_list_of_dicts_by_key([], 'key')==[]
output: def sort_list_of_dicts_by_key(my_list, key):
      return sorted(my_list, key=lambda k: k.get(key, float('inf')))