mercredi 19 décembre 2018

Why does my sub-routine continue to carry out all of my if statements after ive called another sub-routine

My logins() sub routine will continue to carry out both the else and elif parts after it has found a login and has verified the password. I cant seem to understand why its doing this but is really halting my progress. enter image description here

def login ():
Username_Input = input("Please enter your username : ")
logins = open("logins.csv","r")
List_Information = list(csv.reader(logins))
for x in List_Information:# loops through all lists
    if x[0] != Username_Input :
        print("Username not found please register ")
        register () 
    else:
        Password_Input = input("Username found please enter your password : ")
        for x in List_Information:
            if x[1] == Password_Input :
                print("Loged in lets get this game going. ")
                game()
            else :
                print("nope sorry password not found lets go back to the menu : ")
                Menu()

Aucun commentaire:

Enregistrer un commentaire