I have following list of dictionaries:
test_list = [
{'sr_no': 1, 'recipe_type': 'Main Dish', 'name': 'Salmon & Brown Rice'},
{'sr_no': 2, 'recipe_type': 'Side Dish', 'name': 'Cupcakes'},
{'sr_no': 3, 'recipe_type': 'Main Dish', 'name': 'Whole chicken'},
{'sr_no': 4, 'recipe_type': 'Desserts', 'name': 'test'}
]
I need to sort it on base of name
index value alphabetically. As below:
test_list = [
{'sr_no': 2, 'recipe_type': 'Side Dish', 'name': 'Cupcakes'},
{'sr_no': 1, 'recipe_type': 'Main Dish', 'name': 'Salmon & Brown Rice'},
{'sr_no': 4, 'recipe_type': 'Desserts', 'name': 'test'}
{'sr_no': 3, 'recipe_type': 'Main Dish', 'name': 'Whole chicken'},
]
I have searched this on SO and google but find no definite answer.