0
I've been trying this python code and it asks for the password even if the names are different. Can anyone help me out?
name = "" while True: print("who are you?") name=input() if name == "Joe"or"joe": print("what is the password?") else: continue password=input() if password == "swordfish": break print("access granted")
4 Respuestas
+ 2
the 'if' statement in line 5 should be:
if name == "Joe" or name == "joe":
+ 1
You can also use:
if name in ["Joe", "joe"]:
+ 1
you're welcome
0
it worked!
thank you!!!