200-901 · Question #584
Which data structure is created when parsing XML data in Python?
The correct answer is D. dictionary. When parsing XML data in Python (commonly using libraries like xmltodict or processing with xml.etree.ElementTree and converting the result), the XML elements and attributes are mapped into a Python dictionary structure. Keys represent XML tag names and attributes, while values…
Question
Which data structure is created when parsing XML data in Python?
Options
- Aitem
- Blist
- Clibrary
- Ddictionary
How the community answered
(41 responses)- A2% (1)
- C2% (1)
- D95% (39)
Explanation
When parsing XML data in Python (commonly using libraries like xmltodict or processing with xml.etree.ElementTree and converting the result), the XML elements and attributes are mapped into a Python dictionary structure. Keys represent XML tag names and attributes, while values represent the nested content. This makes XML data easy to traverse and manipulate using standard Python dictionary operations. The dictionary is the idiomatic Python data structure for representing hierarchical key-value data derived from XML.
Topics
Community Discussion
No community discussion yet for this question.