Apple tree

Report a typo

Look at the following XML document.

<tree>
    <roots/>
    <trunk>
        <branch apples="5"/>
        <branch apples="6"/>
        <branch apples="3"/>
    </trunk>
</tree>

The tree variable is an instance of the Element class representing this XML element.

What is the result of the following code?

trunk = tree[1]
branch = trunk[2]
print(branch.get("apples"))
Enter a number
___

Create a free account to access the full topic