I'd like to understand why the conjunction of results of IN operator in Python it not working as regular conjunction.
Example:
False and False and True = False
(obvious)'a' in 'ccc' and 'b' in 'ccc' and 'c' in 'ccc' = False
(ok)'a' and 'b' and 'c' in 'ccc' = True
(blows my mind)I'd expect that the third line would return the same values as the first and second ones, but it's not.
Why is it so?
Your Operation results in true as:
result = 'a' and 'b' and 'c' in 'ccc'
#is the same as
result = bool('a') and bool('b') and bool('c' in 'ccc')
#i.e
result = True and True and True #which is true