practice 2
This commit is contained in:
parent
b55a0978d8
commit
9b381a5e96
|
@ -0,0 +1,14 @@
|
|||
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
|
Loading…
Reference in New Issue