Have a look at this brief snippet:
In : a = range(10) In : 3 in a Out: 1 In : 3 not in a Out: 0 In : not (3 in a) Out: 0
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
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).