Python provides the operator is not
: it is more natural to use c is not a
than not c is a
.
>>> a = 8
>>> b = a
>>> b is a
True
>>> b /= 2
>>> b is not a
True
Reminder: is
and is not
test object identity: don't confuse them with ==
and !=
which test object equality.