title: Password system. How do I allow 3 incorrect guesses while allowing the program to continue if the guess is correct
body: <p>The program needs to allow the user 3 incorrect attempts to write the password. However if they get the password attempt right, I want the program to print 'nice'.</p>
  
  <p><strong>Here is what I have so far:</strong></p>
  
  <pre><code>def main():
  
      n = 2
  
      for i in range(0, 3, 1):
  
          attempt = input('Enter password: ')
  
  
          if attempt != 'password':
              print('Incorrect. ' + str(n) + ' attempts left')
  
          n = int(n) - 1
  
          else:
              print('nice')
  </code></pre>