title: python isinstance(n, int) and int(n) == n
body: <p>Two functions:</p>
  
  <pre><code>def check(n):
      if int(n) != n:
          print("int(n) != n")
      else:
          print("int(n) == n")
  </code></pre>
  
  <p>and</p>
  
  <pre><code>def check2(n):
      if not isinstance(n, int):
          print("n is not an int")
      else:
          print("n is an int")
  </code></pre>
  
  <p>What's the difference? And which one is better?</p>