samedi 25 juillet 2015

if and elif function do not execute

print("Please Login!\n")

userName = input("Username: ")
password = input("Password: ")

if userName is "admin" and password is "root":
    print("Welcome back, Admin!\n")

elif userName is "Philip" and  password is "Dingeldong":
    print("Welcome back, Philip Magnus!\n")

else:
    print("Welcome, Guest!")

The if and elif function do not print. I double checked for typos but it won't work. The program jumps directly to the else part and executes that one (of course after i gave my input for the variables). It seems like the program is ignoring the "value" of the variables. Can anyone tell me what I'm doing wrong?

Aucun commentaire:

Enregistrer un commentaire