title: why does this happen in the list?
body: <p>I am gonna print numbers less than 5, but the answer is not what I mean? how should I solve the problem?</p>
  <pre><code>a= [1,2,3,4,5,6,7,8,9]
  for b in a:
   if b&gt;=5:
    a.remove(b)      
  print(a)
  </code></pre>
  <p>answer:</p>
  <pre><code>[1, 2, 3, 4, 6, 8]
  </code></pre>