I have this problem, I want to count how many integers in a list AND sub-lists.
I have this code but doesn't seem to be working:
x = [[1, 3], [0], [2, -4]]
count = 0pos = 0
for i in x[pos]:count = count + len(x[pos])pos = pos + 1
print(count)
Expected 5 because there are 5 elements.