samedi 28 septembre 2019

my if else function is not working correctly, how do i fix it? python

i'm just wondering why this doesn't work, when i say "n" or "no" for the input if works fine but when i say "y" or "yes" for the input it just does the same thing as for "no". everything else in the program runs perfectly apart from this. i have absolutely no clue as to why this is happening.

def restart():
    replay = input("Do you want to restart? (Y/N): ")
    if replay.lower() == "n" or "no":
        print("exiting")
        sys.exit()
    if replay.lower() == "y" or "yes":
        calc()
    else:
        print("Unknown Command")
        restart()
restart()

Aucun commentaire:

Enregistrer un commentaire