How much information?

Report a typo

Write a program that reads a string representing an XML document from input and outputs two numbers: the number of child elements of the root element and the number of attributes the root element has. These numbers should be printed in one line and be separated by a space.

Sample Input 1:

<a attr="123"><b>hello</b><c/></a>

Sample Output 1:

2 1
Write a program in Python 3
from lxml import etree
___

Create a free account to access the full topic