You can employ a nested loop to count number of elements in each sublist of a list
>>> a=[[1, 2, 3], [4, 5, 6]] >>> c=0 >>> for x in a: for y in x: c=c+1 >>> c 6
You can employ a nested loop to count number of elements in each sublist of a list
>>> a=[[1, 2, 3], [4, 5, 6]] >>> c=0 >>> for x in a: for y in x: c=c+1 >>> c 6