Have a look at this brief snippet:
In : a = range(10)
In : 3 in a
In : 3 not in a
In : not (3 in a)
Input/output 4 should strike you as a tad strange if you don’t know Python that well but are familiar with similar constructs in other languages. At first glance, it almost seems like the sense of an operator can be negated with the
Fortunately, this is simply a case of the whole of
not in being a single operator in Python.
e not in S is equivalent to
not (e in S).