My json data will print all the items of my emailList when I do this:
print(data['emailList'])
and it will return this:
[
{
'emailId': 987654321,
'customerId': 123456789,
},
{
'emailId': 56789,
'customerId': 8765,
}
]
How could I include all the possible values for customerId into my final_list? I've tried this:
final_list = []
for each_requ in data:
final_list.append(each_requ)[emailList][customerId]
return final_list
but received this error:
TypeError: list indices must be integers or slices, not str
desired output:
[123456789 ,8765]
print(data['emailList'][customerId])won't print anything.