Skip to content

Commit 4dd5602

Browse files
committed
Chapter 13 - Py4e
1 parent f5e7eca commit 4dd5602

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

ex_13_4_1.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import xml.etree.ElementTree as ET
2+
3+
data = '''
4+
<person>
5+
<name>Sajad</name>
6+
<phone type = "intl">
7+
+98 938 339 4918
8+
</phone>
9+
<email hide = "Yes"/>
10+
</person>'''
11+
12+
tree = ET.fromstring(data)
13+
print("Name:", tree.find("name").text)
14+
print("Email:", tree.find("email").get("hide"))

0 commit comments

Comments
 (0)