title: How to use filter() to remove all strings from a list with strings and numbers?
body: <p>I have a list for example</p>
  
  <pre><code>list = [1,2,3,'t',4,5,'fgt',6,7,'string']
  </code></pre>
  
  <p>and I want to use the <code>filter()</code> function to remove all the strings to leave just numbers.
  I can do it the normal method, but I cant do it with the filter method...any tips?</p>
  
  <p>so:</p>
  
  <pre><code>list(filter(type(i)==str,a)))
  </code></pre>
  
  <p>wouldn't work...I tried to use it, but that still doesn't work:</p>
  
  <pre class="lang-none prettyprint-override"><code>Traceback (most recent call last):
    File "&lt;pyshell#11&gt;", line 1, in &lt;module&gt;
      list(filter(type(a[-1])==str,a))
  TypeError: 'bool' object is not callable
  </code></pre>