Write a python program to sort a list of dictionaries based on a particular key.
list_of_dicts = [{'name': 'Ajay', 'age': 15}, 
                 {'name': 'Bhavna', 'age': 10}, 
                 {'name': 'Cathy', 'age': 12}]
def sort_list_of_dicts(list_of_dicts, key):
    sorted_list = sorted(list_of_dicts, key=lambda i: i[key])
    return sorted_list