for jr in json_reports:
jr['time_created'] = str(jr['time_created'])
在我看来你已经在那儿了
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]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.