import json
# some JSON, could be a file opening :
x = '{ "name":"John", "age":30, "city":"New
York"}'
# parse x:
y = json.loads(x)
# the result is a
Python dictionary:
print(y["age"])
import json
# Data to be written
dictionary ={
"name" : "sathiyajith",
"rollno" : 56,
"cgpa" : 8.6,
"phonenumber" : "9976770500"
}
with open("sample.json", "w") as outfile:
json.dump(dictionary, outfile)