200-901 · Question #394
Which Python function is used to parse a string that contains JSON data into a Python dictionary?
The correct answer is D. json.loads(). json.loads() (load string) deserializes a JSON-formatted string into a Python object (typically a dictionary). The counterpart json.dumps() (dump string) serializes a Python object into a JSON string - the opposite direction. json.parse() and json.to_json() do not exist in…
Question
Which Python function is used to parse a string that contains JSON data into a Python dictionary?
Options
- Ajson.dumps()
- Bjson.to_json()
- Cjson.parse()
- Djson.loads()
How the community answered
(33 responses)- A3% (1)
- B3% (1)
- C9% (3)
- D85% (28)
Explanation
json.loads() (load string) deserializes a JSON-formatted string into a Python object (typically a dictionary). The counterpart json.dumps() (dump string) serializes a Python object into a JSON string - the opposite direction. json.parse() and json.to_json() do not exist in Python's standard json module. Remember: loads = load from string, dumps = dump to string.
Topics
Community Discussion
No community discussion yet for this question.