200-901 · Question #623
What does a developer import in a script to parse a file from XML to Python?
The correct answer is B. library. To parse XML data in Python, a developer typically imports a library that provides the necessary functions and methods for XML parsing. Libraries for XML Parsing: Python has several libraries for parsing XML, such as xml.etree.ElementTree, lxml, and minidom. Functionality…
Question
What does a developer import in a script to parse a file from XML to Python?
Options
- Afunction
- Blibrary
- Cvariable
- Dmethod
How the community answered
(29 responses)- A7% (2)
- B86% (25)
- C3% (1)
- D3% (1)
Explanation
To parse XML data in Python, a developer typically imports a library that provides the necessary functions and methods for XML parsing. Libraries for XML Parsing: Python has several libraries for parsing XML, such as xml.etree.ElementTree, lxml, and minidom. Functionality: These libraries offer functions and methods to read, manipulate, and extract data import xml.etree.ElementTree as ET tree = ET.parse('file.xml') root = tree.getroot()
Topics
Community Discussion
No community discussion yet for this question.