Advertisement
Guest User

Untitled

a guest
Apr 6th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. # Administrator accounts list
  2. adminList = [
  3.    {
  4.        "username": "DaBigBoss",
  5.        "password": "DaBest"
  6.    },
  7.    {
  8.        "username": "root",
  9.        "password": "toor"
  10.    }
  11. ]
  12.  
  13.  
  14. def getCreds():    
  15.    username = input("USERNAME: ")
  16.    password = input("PASSWORD: ")  
  17.    userInfo = {
  18.        "username" : username,
  19.        "password" : password
  20.    }  
  21.    return userInfo
  22.  
  23. def checkLogin(userInfo,adminList):
  24.    global loggedIn
  25.    if userInfo in adminList:
  26.        loggedIn = True
  27.        print("YOU HAVE LOGGED IN!")
  28.        return loggedIn
  29.    else:
  30.        loggedIn = False
  31.        return loggedIn
  32.  
  33.  
  34. getCreds()
  35. checkLogin(" ", " ")
  36.  
  37. while loggedIn == False:  
  38.    getCreds()
  39.    checkLogin(" ", " ")
  40.    print("---------")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement