If they are only nested lists , for example [[[], []], [], [[]]] , here is a good solution:
def depthCount(lst): return 1 + max(map(depthCount, lst), default=0)
Here is a small variation that you could use if you are not using Python 3.4, where the default argument was entered:
def depthCount(lst): return len(lst) and 1 + max(map(depthCount, lst))
They also differ in how they calculate. The first one considers the empty list to be depth 1, the second one to depth 0. The first one is easily adaptable, but just set it to -1 by default.
If they are not just nested lists , for example, [[[1], 'a', [-5.5]], [(6,3)], [['hi']]]) , here is an adaptation to this:
def depthCount(x): return 1 + max(map(depthCount, x)) if x and isinstance(x, list) else 0 def depthCount(x): return int(isinstance(x, list)) and len(x) and 1 + max(map(depthCount, x))
Make sure you understand how the latter works. If you don't already know this, this will teach you how and works in Python :-)
Performing a "purely recursive" task:
def depthCount(x, depth=0): if not x or not isinstance(x, list): return depth return max(depthCount(x[0], depth+1), depthCount(x[1:], depth))
Of course, the extra argument is a little ugly, but I think this is normal.