I try to check if two chars 'x' and '+' are in the array ['+', '-']. I get "True" as the result of this check, even though 'x' is obviously not in the array.
if 'x' and '+' in ['+', '-']:
print('True')
else:
print('False')
I also tried to check this:
if 'x' and '-' in ['x', 'y']:
print('True')
else:
print('False')
This works correctly, 'False' gets printed. What is the mistake?