From 9b381a5e965832e0ca73f7f99c3ea3707cd25cd0 Mon Sep 17 00:00:00 2001 From: Hladu357 Date: Sat, 12 Apr 2025 17:46:50 +0300 Subject: [PATCH] practice 2 --- balance.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 balance.py diff --git a/balance.py b/balance.py new file mode 100644 index 0000000..60175b2 --- /dev/null +++ b/balance.py @@ -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 \ No newline at end of file