I cant get this to stop looping even after correct answer. Any help would be greatly appreciated.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# Administrator accounts list adminList = [ { "username" : "DaBigBoss" , "password" : "DaBest" }, { "username" : "root" , "password" : "toor" } ] # Build your login functions below def getCreds(): username = input ( "What is your username? " ) password = input ( "What is your password? " ) return { "username" : username, "password" : password} def checkLogin(adminList, user_info): if user_info in adminList: getCreds = True print ( "YOU HAVE LOGGED IN!" ) else : getCreds = False print ( "----------" ) print ( "Login Failed" ) print ( "----------" ) retry = getCreds return while True : user_info = getCreds() is_admin = checkLogin(adminList, user_info) print ( "----------" ) if is_admin: print ( "YOU HAVE LOGGED IN!" ) break |