Python‎ > ‎operator‎ > ‎

operator.is_not()

http://www.adilwaseem.com/

Definition
The method return with ouput that a is not b.

Syntax
is not

Parameters
N/A

Examples
The operator return with following output.
 >>> operator.is_not(3,3)
False
>>> operator.is_not("Python","Python")
False
>>> operator.is_not("Python Lake","Python Lake")
False
>>> operator.is_not(["Python","Lake"],["Python","Lake"])
True
>>> operator.is_not(("Python","Lake"),("Python","Lake"))
True
>>> operator.is_not(("Python"),("Python"))
False

is not
The number results are:
 >>> 44 is not 33
True
>>> 44 is not 44
False

The method return false in long string value.
 >>> "Python Lake" is not "Python Lake"
False

str.lower
The method return with:
 >>> "Python Lake".lower() is not "python lake".lower()
True
>>> "Python Lake".lower() is not "python lake"
True

str.capitalize
The string method results on is not is:
 >>> "Python".capitalize() is not "PYTHON"
True
>>> x="Python".capitalize()

variable
The variable results are:
 >>> x
'Python'
>>> x is not 'python'
True
>>> x is not 'Python'
True

len()
Testing the string through built in operation len().
 >>> len("Python Lake") is not len("Python Lake")
False
Comments