Answers for "python json how to get value"

13

python json string to object

import json

x =  '{ "name":"John", "age":30, "city":"New York"}'
y = json.loads(x)

print(y["age"])
Posted by: Guest on May-14-2020
0

get value json python

print(json_object_string)
OUTPUT
{"id":"20", "name":"Bob"}

json_object = json.loads(json_object_string)

print(json_object["name"])
OUTPUT
Bob
Posted by: Guest on March-20-2021
0

python get value from json

for key, value in data.items():
    print key, value
Posted by: Guest on March-12-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language