I have a list of dictionary as below
my_list = [
{'Overall': 'PASS', 'subjects': 4, 'student_id': '90e263', 'data': {'Social': 71, 'Science': 55, 'Maths': 99, 'French': 79}},
{'Overall': 'FAIL', 'subjects': 4, 'student_id': '90e264', 'data': {'Social': 56, 'Science': 18, 'Maths': 61, 'French': 49}}
]
And I would like to add a key:value pair 'class': 'Third Standard'
to all the dictionaries inside the list making the resultant list look like below -
my_list = [
{'Overall': 'PASS', 'subjects': 4, 'student_id': '90e263', 'data': {'Social': 71, 'Science': 55, 'Maths': 99, 'French': 79}, 'class': 'Third Standard'},
{'Overall': 'FAIL', 'subjects': 4, 'student_id': '90e264', 'data': {'Social': 56, 'Science': 18, 'Maths': 61, 'French': 49}, 'class': 'Third Standard'}
]
Note - This is a sample list with just two dictionaries but I've got 1000s of dictionaries in my actual list.
Can someone please help me with best way to update all dictionaries inside the list?