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


Picture showing the output of reading json data in python



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

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250