 <p>As an alternative, you can use <strong>flatten</strong> with <strong>len</strong>:</p> <pre><code>from compiler.ast import flatten my_list = [[1,2,3],[3,5,[2,3]], [[3,2],[5,[4]]]] len(flatten(my_list)) 11 </code></pre> <p>PS. thanks for @thefourtheye pointing out, please note:</p> <p><strong>Deprecated since version 2.6: The compiler package has been removed in Python 3.</strong></p>