Prettification

Report a typo

Print the parse tree for a contacts variable in the box below. Use a special function that will make the output pretty.

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
___

Create a free account to access the full topic