Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Recursively write the definition down solution in Clear category for How Deep by piter239
from collections.abc import Iterable
def how_deep(structure):
if not isinstance(structure, Iterable):
return 0
if structure == ():
return 1
return 1 + max(map(how_deep, structure))
May 17, 2020
Comments: