Identity Operators in Python – CBSE class11
Identity Operator
The identity operator is used to verify or check if both the operands refer to same memory. that mean to compare the memory location of two objects memory identity operators are used.
If both objects refer to the same memory location it returns true other and if not, it returns false accordingly.
There are two types of identity operators in python programming
-
in
-
is not
Now let’s take an example
A=15
B=15
Then,
A is b, will return true
Because both a & b are refining the same memory address of value 15
Note – you can use id () function to confirm that both are referencing same memory address.
Now if you change the value of any variable of a or b then it will not be referencing the same integer object and the result will come Boolean false.
See this,
A=10
B= 15
Then a is b will return false because both variable a & b are not referencing to the same memory location.
Why Standard Library Module in Python
In this tutorial, we have learnt about Identity Operators in python for cbse class 11 & 12 and its related concepts according to cbse syllabus and this topic is very important to start learning python programing language for beginners of class 11th and 12th.This tutorial is also useful for Central Board of secondary education (CBSE) student of class 11th and 12th , who opted computer science (Code 083) as an optional subject.
You can check the latest cbse syllabus for computer science Click here for syllabus OR Click here
UNIT NO. | UNIT NAME | MARKS |
1 | Computational thinking and programming | 40 |
2 | Computer network | 10 |
3 | Database management | 20 |
4 | Practical | 30 |
5 | Total | 100 |
Unit II: Computational Thinking and Programming – 1
According to the syllabus , Unit II Computational Thinking and Programming – 1 has the above concepts for learning related to python Standard Library Module in Python.
Exam Time
Chapter : Identity Operators
IMPORTANT QUESTIONS : Asked in examinations of Class 12th Computer Science
Read more
-
structure of module in python
-
arithmetic operators
-
operators in python
-
types of operators
-
logical operators
-
membership operators
-
standard library module
- Identifiers in python