From 9c2422730cecb2372ae93241b9e4c649f53f881d Mon Sep 17 00:00:00 2001 From: Snehal Mastud <45584726+snehalmastud@users.noreply.github.com> Date: Sun, 23 Feb 2020 12:27:27 +0530 Subject: [PATCH] Python XML! --- XML/XML 1- Find the Score/Solution.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 XML/XML 1- Find the Score/Solution.py diff --git a/XML/XML 1- Find the Score/Solution.py b/XML/XML 1- Find the Score/Solution.py new file mode 100644 index 0000000..df0cb9c --- /dev/null +++ b/XML/XML 1- Find the Score/Solution.py @@ -0,0 +1,4 @@ + +def get_attr_number(node): + return len(node.attrib) + sum(get_attr_number(child) for child in node); +