Working through EDX python course. Not sure why when I use '!=' with 'or' statement code doesn't work as expected.
But I use '==' it does work.
x = input("Enter a letter: ")
if x == 'h' or x =='l' or x =='c':
print('Correct letter')
else:
print('Wrong letter')
x = input("Enter a letter: ")
if x != 'h' or x !='l' or x !='c':
print('Wrong letter')
else:
print('Correct letter')
in the x variable example: entering 'h','l','c' prints 'correct letter' anything else prints 'wrong letter'
in the y variable example: entering 'h','l','c' prints 'wrong letter' all the time