I have a list of dictionaries that look something like this:
list =[{"id": 1, "status": "new", "date_created": "09/13/2013"}, {"id": 2, "status": "pending", "date_created": "09/11/2013"}, {"id": 3, "status": "closed", "date_created": "09/10/2013"}]
What I want to do is the ability to print all the values ββin this list of dictionaries that are related to "id". If it were only one dictionary that I know, I could do this:
print list["id"]
If it was only one dictionary, but how to do it for a list of dictionaries? I tried:
for i in list: print i['id']
but i get an error
TypeError: string indices must be integers, not str
Can someone give me a hand? Thanks!
source share