CiscoCisco
200-901 · Question #268
200-901 Question #268: Real Exam Question with Answer & Explanation
The correct answer is C: dictionary. Common data formats such as JSON, XML, and YAML are best parsed into Python dictionaries because they are inherently key-value structured.
Software Development and Design
Question
Into which type of Python data structure should common data formats be parsed?
Options
- Asequence
- Bset
- Cdictionary
- Dlist
Explanation
Common data formats such as JSON, XML, and YAML are best parsed into Python dictionaries because they are inherently key-value structured.
Common mistakes.
- A. A sequence is a general category in Python (covering lists and tuples), not a specific data structure, and does not capture key-value relationships found in common data formats.
- B. A set stores only unique, unordered, hashable items with no associated values, making it unsuitable for structured data that requires named field access.
- D. A list preserves order and allows duplicates but uses integer indices rather than named keys, so it cannot naturally represent the key-value pairs inherent in formats like JSON.
Concept tested. Parsing structured data formats into Python dictionaries
Reference. https://docs.python.org/3/library/stdtypes.html#mapping-types-dict
Topics
#Python Data Structures#Data Parsing#Dictionaries#JSON
Community Discussion
No community discussion yet for this question.