I was running some nested if statements and my code was not running the way I wanted it to once it reached a certain if statement. I could not figure out what the problem is, so I isolated the code and ran it and I am still getting the same problem. I simplified the code down to a couple of lines and do not see what I am doing wrong.
reset = input('Enter y or q ')
if reset == 'y' or 'Y':
print('If executed, reset is', reset)
else:
print('Else executed, reset is', reset)
When executing the code, the result I get is:
Enter y or q q
If executed, reset is q
I don't understand, my input is q, which sets the variable reset to q. The if statement should only be true is reset == 'y' or 'Y'...I don't get why it is executing.
Thank you for your time.