practice 2

This commit is contained in:
Hladu357 2025-04-12 17:46:50 +03:00
parent b55a0978d8
commit 9b381a5e96
1 changed files with 14 additions and 0 deletions

14
balance.py Normal file
View File

@ -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