Syntax: json.loads(json_string)
Parameter: It takes JSON string as the parameter.
Return type: It returns the python dictionary object.
Syntax: json.dumps(object)
Parameter: It takes Python Object as the parameter.
Return type: It returns the JSON string.
Syntax: dict.update([other])
Parameters: Takes another dicitonary or an iterable key/value pair.
Return type: Returns None.
# Python program to update # JSON import json # JSON data: x = '{"name": "Bob", "languages": "English"}' # python object to be appended y = {"pin":110096} # parsing JSON string: z = json.loads(x) # appending the data z.update(y) # the result is a JSON string: print(json.dumps(z))
{"name": "Bob", "languages": "English", "pin": 110096}
Comments