If I do this: That returns True. Simply because False is in the list. But if I do: That returns False. Whereas not(True) is equal to False: Why? Answer Operator precedence 2.x, 3.x. The precedence of not is lower than that of in. So it is equivalent to: This is what you want: As @Ben points out: It’s recommended to