Issue with variable

Hi,
I have a pin acsess sytem and i have 2 pins that will allow acsess and aother pin for somthing else but the pin for somthing else still works as a true pin…
Please Help!

Code:
pin = “0000”
pin2 = “1234”
pinad = “5555”
attempt = 0

while attempt < 3:
UserPin = input("Enter your 4 diget pin: ")
attempt += 1

if UserPin == pin or pin2:
print(“PIN Correct, you may proceed”)
loggedin = True
attempt = 0
break

Output:
Enter your 4 diget pin: 5555
PIN Correct, you may proceed

Please see:

The code has this problem at the line if UserPin == pin or pin2:. This condition will always pass, because the pin2 string is not empty, so it satisfies the right-hand side of the or.

This need to be if UserPin == pin or UserPin == pin2:

Yes, figured this out!
Thanks for your help!

Or better:

if UserPin in {pin, pin2}:

(A set is slightly more efficient and idiomatic here, but you could also use a tuple or a list, of course)

Indeed, but maybe your comment would be better directed at the OP, rather than at someone who is well aware of the different that one can dance around this particular maypole.