title: python list.iteritems replacement
body: <p>I've got a list in which some items shall be moved into a separate list (by a comparator function). Those elements are pure dicts. The question is how should I iterate over such list.</p>
  
  <p>When iterating the simplest way, <code>for element in mylist</code>, then I don't know the index of the element. There's no <code>.iteritems()</code> methods for lists, which could be useful here. So I've tried to use <code>for index in range(len(mylist)):</code>, which [1] seems over-complicated as for python and [2] does not satisfy me, since <code>range(len())</code> is calculated once in the beginning and if I remove an element from the list during iteration, I'll get <code>IndexError: list index out of range</code>.</p>
  
  <p>Finally, my question is - how should I iterate over a python list, to be able to remove elements from the list (using a comparator function and put them in another list)?</p>