Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Simple recursion solution in Clear category for How Deep by suic
def how_deep(structure, depth=1):
d = depth
for e in structure:
if isinstance(e, tuple):
d = max(how_deep(e, depth=depth+1), d)
return d
April 22, 2019