You are viewing a single comment's thread. Return to all comments →
Working around the constraints of the call...
maxdepth = 0 def _depth(elem, level=0): if len(elem) == 0: return level return max(_depth(child, level + 1) for child in elem) def depth(elem, level=0): global maxdepth maxdepth = _depth(elem, 0)
Seems like cookies are disabled on this browser, please enable them to open this website
XML2 - Find the Maximum Depth
You are viewing a single comment's thread. Return to all comments →
Working around the constraints of the call...