title: How to remove item from a python list in a loop?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1207406/remove-items-from-a-list-while-iterating-in-python">Remove items from a list while iterating in Python</a>  </p>
  </blockquote>
  
  
  
  <p>I'm trying to remove an item from a list in python:</p>
  
  <pre><code>x = ["ok", "jj", "uy", "poooo", "fren"]
  for item in x:
      if len(item) != 2:
          print "length of %s is: %s" %(item, len(item))
          x.remove(item)
  </code></pre>
  
  <p>But it doesn't remove <code>"fren"</code> item. Any ideas?</p>