title: abnormal string list behaviour in python
body: <pre><code>    print difflist
      for line in difflist:
          if ((line.startswith('&lt;'))or (line.startswith('&gt;')) or (line.startswith('---'))):
              difflist.remove(line)
      print difflist
  </code></pre>
  
  <p>Here, initially, </p>
  
  <pre><code>difflist = ['1a2', '&gt; ', '3c4,5', '&lt; staring', '---', '&gt; starring', '&gt; ', '5c7', '&lt; at ', '---', '&gt; add ', '']
  </code></pre>
  
  <p>And what i expect of the code is to print </p>
  
  <pre><code>['1a2', '3c4,5', '5c7', '']
  </code></pre>
  
  <p>But what i get instead is </p>
  
  <pre><code>difflist= ['1a2', '3c4,5', '---', '&gt; ', '5c7', '---', '']
  </code></pre>