Objective
Walking the whole tree of an XML document is as simple as iterating over the root element with iter().
Instructions
- The input is a line with an XML document.
- Show, sorted alphabetically by tag, how many times each one appears (the root included), with the format
tag: n.
<lib><book/><book/><dvd/></lib>
book: 2
dvd: 1
lib: 1
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise