Create a function in Python to sort a list of dictionaries by a particular key.
Example of a list of dictionaries
def sort_list(lst, key):
    # Sorts a list of dictionaries
    return sorted(lst, key=lambda k: k[key])