Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for How Deep by kazuki.h
def how_deep(structure):
if not isinstance(structure, tuple):
return 0
elif structure == ():
return 1
else:
return max([how_deep(element) for element in structure]) + 1
May 20, 2021
Comments: