vendredi 10 juin 2016

Python Flow Controls Not Working

Ok so in this I have an issue where if the answer is N then it will still continue to the else statement then break. How do I fix this? (this is all in a function, edit: with other if statements that work fine)

 if command == "Exit":
        exit = 1
        while exit == 1:
            print("Quit? Y/N:", end="")
            ex = input()
            if ex == "Y":
                quit()
            elif ex == "N":
                break
            else:
                print("Err")

Aucun commentaire:

Enregistrer un commentaire