Reputation: 13286
for jr in json_reports:
jr['time_created'] = str(jr['time_created'])
Upvotes: 1
Views: 277
Reputation: 35497
That would be the pythonic way to write the loop if you need to assign it to the same list.
If you just want to pull out strings of all time_created
indices in each element of json_reports
, you can use a list comprehension:
strings = [str(i['time_created']) for i in json_reports]
Upvotes: 5