title: How to create a pin checker
body: <p>I'm very new to python and trying to create a pin checker. Iv'e done most of it, but Iv'e got a problem with trying to get the code to reject the users attempts to enter letters or a combination of letters and numbers, so the code treats it as a incorrect answer. My code just crashes if letters are entered. I tried removing the int before the input statement, which makes it reject letters like I want it to, but now longer accepts the correct code.</p>
  <pre><code>
  pin = {1111}  # Correct pin code
  
  count = 1        # Count function to allow code to recongise restrict pin attempts to three and to terminate code if three incorrect pins are entered
  
  while True:
      enter_pin = int(input(&quot;Enter your pin: &quot;)); # Ask user for pin code
      if (enter_pin) in pin:
          print(&quot;&quot;)
          print(&quot;Correct pin&quot;)
          print(&quot;&quot;)
          print(&quot;Access granted&quot;)   # Grant access if correct pin entered
          break
      print(&quot;&quot;)
      print(&quot;Incorrect pin. Please try again&quot;)   # Repeat question and allow another attempt if wrong pin is given
      print()
      count += 1
      if count == 4:
          print(&quot;Incorrect pin entered three times, system locked&quot;)
          break
  
  </code></pre>
  <p>What I want:</p>
  <p>Enter your pin: 46166</p>
  <p>Incorrect pin. Please try again</p>
  <p>Enter your pin: egsrgsd</p>
  <p>Incorrect pin. Please try again</p>
  <p>Enter your pin: 1111</p>
  <p>Correct pin</p>
  <p>Access granted</p>