boby shmurda

mail@pastecode.io avatar
unknown
python
2 months ago
1.9 kB
2
Indexable
Never
# -------------------------------------------------------------------
# Global variables
# -------------------------------------------------------------------
userTable = [["LArmstrong3", "RedChair"],
             ["SBarrett7", "PurpleDesk"],
             ["EChisholm4", "YellowStool"],
             ["VDunn1", "OrangeFuton"],
             ["DElms5", "GreenCouch"],
             ["EFirsova13", "PinkMattress"],
             ["JGolland6", "GreenTable"],
             ["FHartley13", "BrownMirror"],
             ["DJohnstone12", "GoldBed"],
             ["GKirkhope8", "WhiteNights"],
             ["LLemon8", "BeigeDresser"],
             ["HMacCunn6", "GreyOttoman"],
             ["PNewland10", "BlackWardrobe"],
             ["AOldham5", "OrangeFuton"],
             ["JPook8", "YellowStool"]]

# =====> Write your code here
userNameCorrect = False
passwordCorrect = False
userName = input("what is your username?")
password = input("what is your password?")
if userName == "" or password == "":
    print("username or password is blank please type in your username and password and try again")
    userName = input("what is your username?")
    password = input("what is your password?")
# -------------------------------------------------------------------
# Main program
# -------------------------------------------------------------------

# =====> Write your code here

for i in range(0,len(userTable)+1):
    if userName == userTable[i][0]:
        userNameCorrect = True
    else:
        print("userName is not correct")
        break
    if password == userTable[i][1]:
        passwordCorrect = True
    elif userNameCorrect == True and passwordCorrect == False:
        print("username correct but password wrong")
        break
    
    if passwordCorrect == True and userNameCorrect == True:
        print("username and password is correct")
        break
Leave a Comment