A have a real problem (and a headache) with an assignment...
I\'m in an introductory programming class, and I have to write a function that, given a list, will retur
A short addition to what has been said so it can handle empty lists too:
def list_depth(list_of_lists): if isinstance(list_of_lists, list): if(len(list_of_lists) == 0): depth = 1 else: depth = 1 + max([list_depth(l) for l in list_of_lists]) else: depth = 0 return depth