Certified Professional in Python Programming (PCPP-32-101) — Question 14
Which one of the following methods allows you to debug an XML tree in the xml.etree.ElementTree module?
Answer options
- A. debug
- B. dump
- C. log
- D. parse
Correct answer: B
Explanation
The 'dump' method is specifically designed to output the entire XML tree structure to the console, making it useful for debugging purposes. The 'debug' and 'log' options do not exist in the xml.etree.ElementTree module, while 'parse' is used for reading XML data into an ElementTree object, not for debugging.