Identity Operator
Python supports two types of identity operators and these are
- is operator
- is not operator
is operator
These operators are used for comparison of the memory locations of the objects. is operator returns True if both sides of the operator point to the same object and returns False if not.
a=85 b=a print(a is b)Output
True
is not operator
is not operator returns True if both sides of the operator does not point to same object and False if they point to same object.
a=85 b=85 print(a is not b)Output
False
0 comments :
Post a Comment
Note: only a member of this blog may post a comment.