title: I want to remove all strings from a list of integers. Why doesn't this work?
body: <p>When I run this code, it works, but for some reason it only removes the 'p' and 'h' strings and not the 'z' string. Why?</p>
  
  <pre><code>def filter_list(l):
      for item in l:
          if item == str(item):
              l.remove(item)
      return l
  print(filter_list([1, 9, 3, 'p', 'z', 7, 'h']))
  </code></pre>
  
  <p><code>output:[1, 9, 3, 'z', 7]</code></p>