Skip to content
Advertisement

Tag: depth

How can I count the depth in a list of lists?

I want to count the depth in a list of lists, so not the amount of elements but the maximum depth one list can have. This is my function: should return 4 Answer You can try: Output: Explanation: First check if object passed into the recursive function is of type list: If so, proceed to add up the Trues in

Advertisement