How do i sort a list of dictionaries by a specific key in python?

Example:

data = [{'name': 'John', 'age': 25}, {'name': 'Doe', 'age': 30}]
sorted_data = sorted(data, key=lambda x: x['age'])
Use the `sorted()` function along with a lambda function to specify the key by which to sort a list of dictionaries.

Beginner's Guide to Python