I'm searching a list to see if it contains one of several elements within it using Python's "in" statement. I'm finding issues however. Here's a MWE:
print (1 or 2 or 3) in [1, 2, 3]
print (1 or 2 or 3) in [2, 3]
Both statements should return True
, but the actual output is:
True
False
It seems that what the code is actually doing is simply searching for the number 1 in the list, rather than 1, 2, or 3. Why is it doing this, and how can I modify the code to behave correctly?