Monday 13 March 2023

Identity Operators

 Identity Operator

Python supports two types of identity operators and these are
  1. is operator
  2. 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.

Machine Learning

More

Advertisement

Java Tutorial

More

UGC NET CS TUTORIAL

MFCS
COA
PL-CG
DBMS
OPERATING SYSTEM
SOFTWARE ENG
DSA
TOC-CD
ARTIFICIAL INT

C Programming

More

Python Tutorial

More

Data Structures

More

computer Organization

More
Top