input: Write a python function to sort a list of dictionaries by a given key.
  assert sort_dict_list([{"name": "John", "age": 25}, {"name": "Jane", "age": 22}, {"name": "Doe", "age": 30}], "age") == [{"name": "Jane", "age": 22}, {"name": "John", "age": 25}, {"name": "Doe", "age": 30}]
  assert sort_dict_list([{"name": "Alice", "score": 90}, {"name": "Bob", "score": 85}, {"name": "Charlie", "score": 95}], "score") == [{"name": "Bob", "score": 85}, {"name": "Alice", "score": 90}, {"name": "Charlie", "score": 95}]
  assert sort_dict_list([{"fruit": "Apple", "price": 1.2}, {"fruit": "Banana", "price": 0.5}, {"fruit": "Cherry", "price": 2.5}], "price") == [{"fruit": "Banana", "price": 0.5}, {"fruit": "Apple", "price": 1.2}, {"fruit": "Cherry", "price": 2.5}]
output: def sort_dict_list(dict_list, key):
      return sorted(dict_list, key=lambda x: x[key])