I notice there is a comparison operator is not. Should I literally translate it into 
!=    instead of
== not 
                is and is not are the identity operators in Python. They are used to check if two values (or variables) are located on the same part of the memory. Two variables that are equal does not imply that they are identical.
The 'not' is a Logical operator in Python that will return True if the expression is False. The 'not' operator is used in the if statements. If x is True, then not will evaluate as false, otherwise, True.
To expand on what Ignacio said:
a == b and a != b test whether two objects have the same value. You can override an object's __eq__ and __ne__ methods to determine what that means.
a is b and a is not b test whether two objects are the same thing. It's like doing id(a) == id(b)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With