nerdexam
Cisco

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…

Understanding and Using APIs

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)
  • A
    3% (1)
  • B
    3% (1)
  • C
    9% (3)
  • D
    85% (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

#Python JSON#json.loads()#Data parsing#Serialization/Deserialization

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice