As far as I know, the in operator in Python can't be chained or at least I couldn't find any info on it, here is my problem
Here is the code
arr = [1, True, 'a', 2]
print('a' in arr in arr) # prints False
print(('a' in arr) in arr) # prints True
What I don't understand is the first print, I know in the second the first in returns True and then it check if True is in arr, but what about the first one? Does it check if 'a' is in arr and then if arr is in arr?
inoperator can indeed be chained, see the docs. This is definitely a duplicate then... - juanpa.arrivillagaa in b in cis equivalent to(a in b) and (b in c), just like any other operator chaining. - abarnert