On Finding the Maximum Depth of an Arbitrarily Nested List
问题 I'm currently working with a recursive function in Python, and I've run into a wall. As titled, the problem is to return the maximum depth of an arbitrarily nested list. Here is what I have so far: def depthCount(lst): 'takes an arbitrarily nested list as a parameter and returns the maximum depth to which the list has nested sub-lists.' var = 0 if len(lst) > 0: if type(lst[0]) == list: var += 1 depthCount(lst[1:]) else: depthCount(lst[1:]) else: return var I feel that the problem is with my