Python : How `len()` is executed
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1115313/cost-of-len-function">Cost of len() function</a>  </p>
</blockquote>



<p>How Python calculates length of a list(using <code>len()</code> function )?Does it go through a <code>for</code> or <code>while</code> <em>loop</em> to do the same or it has some internal variable that stores the length of the list ?</p>
