title: Does the enumerate() function count elements in advance?
body: <p>To support indexing over a collection Python includes <a href="http://www.python.org/dev/peps/pep-0279/" rel="nofollow">enumerate()</a> function. It provides index over collection.</p>
  
  <pre><code>for index, item in enumerate(list):
      # do domething
      print index
  </code></pre>
  
  <p>In my case I have a huge list and wonder if it is faster to create index manually that use <a href="http://www.python.org/dev/peps/pep-0279/" rel="nofollow">enumerate()</a>? e.g.</p>
  
  <pre><code>index = 0
  for item in list:
      # do something
      print index
      index = index + 1
  </code></pre>