I have a list like p = [[[[[[[[1, 2, 3]]]]]]]], I want to get the count of the items in the list including empty lists, so for this list I should get 10. I am trying to enumerate the list like –
for idx, item in enumerate(p):
count = count + idx
but I am not able to get the empty lists there. Please advice.
Shorter version of code below:
More detailed code