I'm trying to do a recursive function in Python that is not assigning me the correct results and when I try to change it it always happens stack overflow. My code is this:
def sublistas(lista):
i=0
if not isinstance(lista,list):
return 0
elif type(lista[i])==list:
return sublistas(lista[i])+(1)
else:
return 0
Is anyone able to help me figure out what's wrong here?