title: Simple function asking for positive integer and verifying input
body: <p>I'm simply trying to create a function asking for a positive integer and then verifying that the input is indeed a positive integer:</p>
  
  <pre><code>def int_input(x):
      x = input('Please enter a positive integer:')
      if x != type(int()) and x &lt; 1:
          print("This is not a positive integer, try again:")
      else:
          print(x)
  
  int_input(x)
  </code></pre>
  
  <p>It's giving me "NameError: name 'x' is not defined".</p>
  
  <p>It's so ridiculously simple I feel like I should have found lots of posts on this so maybe I'm blind...</p>
  
  <p>Thanks!</p>