dict = [
{"name": "Fuad", "age": 22},
{"name": "Bristy", "age": 20},
{"name": "Tonni", "age": 17},
{"name": "Riya", "age": 15},
{"name": "Badol", "age": 19},
]
print("Result after sort - ")
res = sorted(dict, key=lambda x: x['age'], reverse=True)
print(res)
dict = [
{"name": "Fuad", "age": 22},
{"name": "Bristy", "age": 20},
{"name": "Tonni", "age": 17},
{"name": "Riya", "age": 15},
{"name": "Badol", "age": 19},
]
print("Result after sort - ")
print(sorted(dict, key=lambda x: x['age']))
print("
")