I'm trying to append python list with two values returned as json within data
into my final_list
.
My code:
data = json.loads(r.text)
final_list = []
for each_req in data:
final_list.append(each_req(['requestId'],['author']))
return final_list
Error:
TypeError: 'dict' object is not callable
If I try the same but only with requestId
it works fine:
data = json.loads(r.text)
final_list = []
for each_req in data:
final_list.append(each_req['requestId'])
return final_list
list then contains values like '12345' etc.
How can I append final_list to look like:
'12345 John Doe'