SyntaxFix
Write A Post
Hire A Developer
Questions
You can do it with reduce:
a = [[1, 2, 3], [4, 5, 6], [7, 8, 9], [], [1, 2]] print(reduce(lambda count, l: count + len(l), a, 0)) # result is 11