input: Write a function to sort a list of dictionaries by a specified key in each dictionary. If the given argument for the key is not present in any dictionary, raise a KeyError.
  
  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([{'name': 'Tom', 'age': 25}, {'name': 'John', 'age': 21}, {'name': 'Adam', 'age': 26}], 'height') # This should raise a KeyError because 'height' is not a key in any dictionary
output: def sort_list_of_dicts_by_key(lst, key):
      for d in lst:
          if key not in d:
              raise KeyError(f"Key '{key}' not found in dictionary")
      return sorted(lst, key=lambda x: x[key])