Source Code:
(back to article)
data = [{'name': 'Alice', 'age': 25}, {'name': 'Bob', 'age': 30}, {'name': 'Eve', 'age': 20}] sorted_data = sorted(data, key=lambda x: x['age'], reverse=True) print(sorted_data)
Result:
Report an issue