200-901 · Question #9
Refer to the exhibit. Which Python data structure does my_json contain?
The correct answer is D. Dict. When Python's json.loads() (or equivalent) parses a JSON object (curly-brace {} structure), it produces a Python dictionary (dict). Although the variable is named my_json, the name is misleading - after parsing, the value is a native Python dict, not a JSON string. 'JSON' (B)…
Question
Refer to the exhibit. Which Python data structure does my_json contain?
Exhibit
Options
- AList
- BJson
- CMap
- DDict
How the community answered
(53 responses)- A2% (1)
- B2% (1)
- C4% (2)
- D92% (49)
Explanation
When Python's json.loads() (or equivalent) parses a JSON object (curly-brace {} structure), it produces a Python dictionary (dict). Although the variable is named my_json, the name is misleading - after parsing, the value is a native Python dict, not a JSON string. 'JSON' (B) is a serialization format, not a Python data structure. A Python list (A) would result from parsing a JSON array ([]). map (C) is either a Python built-in function or a lazy iterator, not a data structure produced by JSON parsing.
Topics
Community Discussion
No community discussion yet for this question.
