title: False Iteration
body: <p>I want to write a <code>for</code> loop that tests two functions on a <code>list</code>. First one gives back an int, second a <code>boolean</code>. If <code>boolean == False</code> the function should remove the element from the list so in the end after calling the function L should have mutated. Here is an example.</p>
  
  <pre><code>def f(i):
      return i + 2
  
  def g(i):
      return i &gt; 5
  
  L = [0, -10, 5, 6, -4]
  
  def applyF_filterG(L, f, g):
      for i in L:
          if g(f(i)) == False:        
              L.remove(i)
  
  L = [5, 6]
  </code></pre>
  
  <p>My problem is that with the function written above I get <code>L = [-10, 5, 6]</code> back because if <code>i</code> is removed, the <code>i+1</code> turns into an <code>i+2</code> because of the removed element. Does anybody know how to solve this? Big thanks!</p>