title: Simple password check with limited retries
body: <p>I'm trying to do a simple password check with limited retries.</p>
  
  <p>If user keys in wrong password, program prompts to try again (3 retries).
  After 3 failed retries, program prompts user has reached maximum retries.
  If User keys in correct password, program will "grant access".</p>
  
  <pre><code>import sys
  print (sys.version)
  pssw = '' 
  attempt = 0   
  
  print('Please key in your password.') 
  
  while (pssw != "remember") and (attempt &lt; 3):    
      pssw = input()  
      attempt = attempt + 1
  
  print ('No that is not correct. Try again.')
  
  if attempt == 3:
      print ('Sorry you have reached maximum number of attempts')
      break
  
  if (pssw == "remember"):
      print('Access Granted!') 
  </code></pre>
  
  <p>Problem #1</p>
  
  <p>Expectation: After keying in the correct password "Remember", program should print output "Access Granted"</p>
  
  <p>But program output:</p>
  
  <pre><code>3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06) 
  Please key in your password.
  remember
  No that is not correct. Try again.
  Access Granted!
  </code></pre>
  
  <p>Problem #2</p>
  
  <p>Expectation: After keying in the correct password "Remember" on the last try, program should print output "Access Granted"</p>
  
  <p>But program output:</p>
  
  <pre><code>Please key in your password.
  test
  No that is not correct. Try again.
  test
  No that is not correct. Try again.
  remember
  No that is not correct. Try again.
  Sorry you have reached maximum number of attempts
  </code></pre>
  
  <p>What am I doing wrong?</p>