0
whats wrong?
the problem is when i write "Yahel" and at the password "1234" its not saying what it supposed to say... code: my_input = input ("Enter your name:\n") my_input = my_input.capitalize() my_pass = input ("Enter your password:\n") Pass_not_correct = my_pass != 1234 Name_not_correct = my_input != "yahel" if my_input == "Yahel" and my_pass == 1234: print ("Hello " + my_input + " , you are logged in...") elif my_input == "Yahel" and Pass_not_correct: print ("the password is incorrect.") elif Name_not_correct and my_pass == 1234: print ("the name is incorrect") else: print ("your name is not in the System")
3 odpowiedzi
+ 2
cuz you are testing 1234 against "1234"
Make ur boolean variable look like this:
Pass_not_correct = my_input != "1234"
This is bcuz input() returns a string rather than a number
+ 1
Thunderbolt thank you!
0
yahel make a habit to attach file with code. Sometimes to debug the code user has to run it.