title: filter strings from a list
body: <p>I am trying to filter strings from a list.
  The assignment is:</p>
  
  <p>Create a function that takes a list of non-negative numbers and strings and return a new list without the strings.</p>
  
  <p>This is my code:</p>
  
  <pre><code>def filter_list(lst):
      intlist = []
      while len(lst) &gt; 0:
          if isinstance(lst[0],int):
              if lst[0] &gt;= 0
                  intlist.append(lst[0])
                  lst.remove(lst[0])
              else:
                  lst.remove(lst[0])
          if isinstance(lst[0],str):
              lst.remove(lst[0])
      return (intlist)
  </code></pre>
  
  <p>It gives me an error, and it seems I get stuck in an infinite while loop, although I do not understand how, as I gradually remove items from the list, and the loop ends when the list is empty.</p>