JSON Module
import json
data = '{"First":"Audi","Second":"BMW","Third":"Maruti Suzuki","Fourth":"Ferrari"}'
print(data)
parsed = json.loads(data)
print(parsed['First'])
print(type(parsed))
# g = open("CARS","r")
# var1 = g.read()
# print(var1)
# g.close()
data2 = {
"channel":"star plus",
"cars":["bmw","ferrari","ford","maruti suzuki"],
"numbers": 123456789,
"isgood": True
}
jscomp = json.dumps(data2)
print(jscomp)
Comments
Post a Comment