0

how to do when the user enters the wrong user & pass, then the program will display the output sorry the user is'nt recognized

# Login userBiasa = {"user" : ["lala"], "pCodeUser" : ["lala123"]} superUser = {"userAdmin" : ["admin"], "pCodeAdmin" : ["admin123"]} x = 0 when I accidentally blame the username and password of admin/user an error display appears containing Traceback (most recent call last): File "main.py", line 90, in <module> search = ordinary user.get("user").index(usPut) ValueError: 'laa' is not in list elif pil == 2: usPut = input("Username : ") pasPut = input("Password : ") search = userBiasa.get("user").index(usPut) if usPut == userBiasa.get("user")[search] and pasPut == userBiasa.get("pCodeUser")[search]: print("Login succes") x = 2 break else : print("username not recognized") continue so here the point is that when I enter the wrong username and password, the output will be sorry the username and password are not recognized how to

11th Nov 2021, 12:08 PM
Ali Khatami
Ali Khatami - avatar
1 Answer
+ 3
Can we see the full code in the playground please?
11th Nov 2021, 1:01 PM
Slick
Slick - avatar