arr = [1, True, 'a', 2]
print('a' in arr in arr) # False
Can you explain me why this code will output 'False'?
The question is closed.
Answer from @KlausD.: Actually it is a comparison operator chaining and will be interpreted as ('a' in arr) and (arr in arr).
I believe this is what you are trying to do:
Output:
Or this:
Output: