Advertisement
Guest User

Untitled

a guest
Nov 24th, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1.  
  2. account = 'user'
  3. password1 = 'pass'
  4.  
  5. while True:
  6.    print('Please provide user name: ')
  7.    username = input()
  8.    if username == account:
  9.       for t in range(3):
  10.          print('Welcome ' + account + '  Please provide your password: ')
  11.          password = input()
  12.          if password == password1:
  13.             print('Welcome ' + account)
  14.             break
  15.          else:
  16.             print('Incorrect password.' + ' This is your ' + str(t + 1) + ' try.')
  17.             if t == 3:
  18.               print('You have entered an incorrect password for ' + account + ' You are logged out.')
  19.               break
  20.    else:
  21.       print('User does not exist.')
  22.    break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement