We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- XML
- XML 1 - Find the Score
- Discussions
XML 1 - Find the Score
XML 1 - Find the Score
Sort by
recency
|
204 Discussions
|
Please Login in order to post a comment
in this challenge, root carry all the xml element as a string but with clarity of lines so if we iterate it using root.iter we iter each element or we say each line individualy afcourse it is done by using loop and in each iteration we use iterpointer(i) in loop and count the i.attrib because here this will give all attribute in form of dict and after that we find the len of that dict which have attribute and save it ,so now you will understand the logic behind this there are many functions of xml you can directly explore it using ai , python webpage and other ways above is my code-:
My version :
Note : class the comments by votes and look at the first one. Displays a very much nicer solution based on the comprehension of the root.iter() method.