Articles → Python → Read json data in python

Read json data in python






Example


import json

# some JSON:
x =  '{ "name":"Karan", "age":37, "city":"Gurgaon"}'

# parse x:
y = json.loads(x)

# the result is a Python dictionary:
print("name:", y["name"])
print("age:", y["age"])
print("city:", y["city"])



Output



Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Monday, June 10, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250