Hey guys,
Trying to figure out why my "not equals" operator doesn't work in this OR statement:
Whatever I input, it always returns True. If I type in 'y' or 'yes', it should execute my else statement *scratches head*. I've tried putting my conditions into ()'s and such and no dice. Someone please show me the light . Thanks!
Trying to figure out why my "not equals" operator doesn't work in this OR statement:
Code:
#!/usr/bin/env python3
import sys
readyprompt = input("Are you ready? [y/n]\n>")
ans = readyprompt.lower()
if ans != "y" or ans != "yes":
print("Quitting. Please run " + sys.argv[0] + "when ready")
else:
print("Executing scripts!")
Whatever I input, it always returns True. If I type in 'y' or 'yes', it should execute my else statement *scratches head*. I've tried putting my conditions into ()'s and such and no dice. Someone please show me the light . Thanks!