14 lines
317 B
Python
14 lines
317 B
Python
from xml.etree import ElementTree as ET
|
|
|
|
dom = ET.parse("xml-sample-file.xml")
|
|
rows = dom.findall('row')
|
|
|
|
s = {}
|
|
for element in rows:
|
|
n = element.find('name').text
|
|
c = int(element.find('creditBalance').text)
|
|
if c > 50:
|
|
s[n] = c
|
|
|
|
print(s)
|
|
# pull names of custommers with credit ballance over 50 |