Print the parse tree for a contacts variable in the box below. Use a special function that will make the output pretty.
BeautifulSoup: working with XML
Prettification
Report a typo
Write a program in Python 3
from bs4 import BeautifulSoup
contacts = '<?xml version="1.0" encoding="UTF-8"?><contacts><contact><name>Tyrion Lannister</name><prefix>Work</prefix></contact><contact><name>Jon Snow</name><prefix>Personal</prefix></contact><contact><name>Arya Stark</name><prefix>Personal</prefix></contact><contact><name>Daenerys Targaryen</name><prefix>Work</prefix></contact></contacts>'
# put your code here
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.