count = 0
p = 0
flag = True
def depth(s):
count = 0
p = 0
if type(s) == list:
count += 1
return depth(s[0])
else:
if p < count:
p = count
flag = False
count = 0
return depth(s[1:])
return p
def depth(arr):
if hasattr(arr, '__getitem__'):
return max(depth(i) for i in arr) + 1
else:
return 0
def depth(arr):
if hasattr(arr, '__getitem__'):
return max(map(depth, arr)) + 1
else:
return 0