How do I access the world_population
key data in the following json data using python ?
{
"ok": true,
"body": { "world_population": 7795232630, "total_countries": 235 }
}
How do I access the world_population
key data in the following json data using python ?
{
"ok": true,
"body": { "world_population": 7795232630, "total_countries": 235 }
}
Assuming you have your json in a string format you can do it like this:
import json
your_json = '{"ok": true,"body": { "world_population": 7795232630,"total_countries": 235 }}'
parsed = json.loads(your_json)
print(parsed["body"]["world_population"])