title: Which is the most efficient way to iterate through a list in python?
body: <p>Say I have a list of items:</p>
  
  <pre><code>x = [1, 2, 3, 4, 5]
  </code></pre>
  
  <p>I need to perform some functions for each of these items. In a certain case, I need to return the index of an item.</p>
  
  <p>Which is the best and most efficient way?</p>
  
  <pre><code>for item in list:
      ....
  </code></pre>
  
  <p>or</p>
  
  <pre><code>for i in range(len(list)):
      ....
  </code></pre>