input: Write a Python function to sort a list of dictionaries by the 'age' key.
  assert sort_by_age([{'name': 'Ethan', 'age': 24}, {'name': 'Sophia', 'age': 19}, {'name': 'Liam', 'age': 35}]) == [{'name': 'Sophia', 'age': 19}, {'name': 'Ethan', 'age': 24}, {'name': 'Liam', 'age': 35}]
  assert sort_by_age([{'name': 'Mia', 'age': 25}, {'name': 'John', 'age': 30}, {'name': 'Eva', 'age': 45}]) == [{'name': 'Mia', 'age': 25}, {'name': 'John', 'age': 30}, {'name': 'Eva', 'age': 45}]
  assert sort_by_age([{'name': 'Emma', 'age': 35}, {'name': 'Noah', 'age': 22}, {'name': 'Isabella', 'age': 27}]) == [{'name': 'Noah', 'age': 22}, {'name': 'Isabella', 'age': 27}, {'name': 'Emma', 'age': 35}]
output: def sort_by_age(list_of_dicts):
      return sorted(list_of_dicts, key=lambda x: x['age'])