title: Python check if list items are integers?
body: <p>I have a list which contains numbers and letters in string format.</p>
  
  <pre><code>mylist=['1','orange','2','3','4','apple']
  </code></pre>
  
  <p>I need to come up with a new list which only contains numbers:</p>
  
  <pre><code>mynewlist=['1','2','3','4']
  </code></pre>
  
  <p>If I have a way to check if each item in list can be converted to Integer, I should be able to come up with what I want by doing something like this:</p>
  
  <pre><code>for item in mylist:
      if (check item can be converted to integer):
          mynewlist.append(item)
  </code></pre>
  
  <p>How do I check that a string can be converted to an integer? Or is there any better way to do it?</p>