Skip to content

Select XML tags that have certain tags inside them

I am parsing an xml file with Python using ElementTree, and I need to select tags like <PostalAddressText> below that have tags like <insert> inside them. How do I do that? I need to get a list of all relevant tag names in the xml file that satisfy the condition. Here’s a fragment of XML tha…

How can I find the sum of a users input?

Above is a code I have so far. It prints: My goal is for the code to add up the two services and make a total price. My end goal should look like this: Notice how the code added both prices and made a “Total.” Is there any way I can do this? I’m a beginner computer science major, so