Advertisement
rdhammack

Basic Login Credential Checker in Python

Feb 5th, 2017
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.16 KB | None | 0 0
  1. #Login Checker #1.3
  2. #
  3. #Dustin Hammack
  4. #Jan. 31, 2017
  5.  
  6. #CORRECTLY WORKING VERSION
  7.  
  8.  
  9. print('\n\t\t\tHere is a friendly user login sytem. ')
  10. print('\t\t\tYou have 3 chances to login after setting your, ')
  11. print('\t\t\tusername and password. If you are a guest, you ')
  12. print('\t\t\tcan login as guest with EITHER username or password.')
  13.  
  14.  
  15. name = input('\n\n\nPlease tell me your name: ')
  16. yourUsername = input('Please set your username ')
  17. yourPassword = input('Please set your password ')
  18. tries = 3
  19.  
  20.  
  21. while(tries >= 1):
  22.     username = input('\n\nUsername: ')
  23.     password = input('Password: ')
  24.     if (username == yourUsername and password == yourPassword):
  25.         print('\n\n Welcome ' + name + '!')
  26.         tries -= 4
  27.     elif (username == 'guest' or password == 'guest'):
  28.         print('Welcome Guest! Take a look around if you please')
  29.         tries -= 4
  30.     if(tries >= 2):
  31.         if(username != yourUsername or password != yourPassword):
  32.             print('Please try again!')
  33.     tries -= 1
  34.     if (tries == 0):
  35.         print('You are NOT welcome here!')
  36.    
  37.  
  38.  
  39.  
  40.  
  41.    
  42.  
  43. print()
  44. print()
  45.  
  46. print(input('Press enter to quit the program '))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement