Answers for "Convert from JSON to Python"

2

Convert from JSON to Python

import json

# some JSON:
x =  '{ "name":"John", "age":30, "city":"New York"}'

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

# the result is a Python dictionary:
print(y["age"])
Posted by: Guest on February-01-2021

Code answers related to "Convert from JSON to Python"

Code answers related to "Javascript"

Browse Popular Code Answers by Language