Here is one way to write the function
depth = lambda L: isinstance(L, list) and max(map(depth, L))+1
I think the idea you are missing is to use max()
Here is one way to write the function
depth = lambda L: isinstance(L, list) and max(map(depth, L))+1
I think the idea you are missing is to use max()