I am making a quick zork game but I ran into this problem using the "or" operator. I thought this would be simple but I can't figure out why this isn't working. Right now if you type in "n" you should get "this works" because it equals the string "n". Instead it prints out "it works" AND "this works" so obviously I used "or" wrong.
x=0
while x<20:
response = input("HI")
if response!= 'n':
print("it works")
if response == 'n':
print("this works")
x+=1
Before using or it works
x=0
while x<20:
response = input("HI")
if (response!= 'n') or (response != 's'):
print("it works")
if (response == 'n') or (response == 's'):
print("this works")
x+=1
After using or it prints both out. It probably something obvious -.-