Python use != for not equal comparison. To determine whether two objects are identical or not, use is and is not.
!=
is
is not
>>> x = 1 >>> y = 2 >>> z = 1 >>> x != y
True
>>> x != z
False
>>> z is x