- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are different Identity operators types in Python?
Each Python object is assigned a unique identification number when it is stored in memory. It can be fetched by id() function.
The is operator compares id() of two objects and returns True if both objects have same value otherwise it returns false.
The is not operator on the other hand returns false if id() of objects is same and true otherwise. Following piece of interpreter activity will show the behaviour −
>>> a = 10 >>> b = a >>> id(a), id(b) (1581561184, 1581561184) >>> a is b True >>> a is not b False >>> a = 10 >>> b = 20 >>> id(a), id(b) (1581561184, 1581561504) >>> a is b False >>> a is not b True
- What are different assignment operators types in Python?
- What are different bitwise operators types in Python?
- What are different basic operators in Python?
- What are different arithmetic operators in Python?
- Different types of operators in C++
- What are different types of quotes in Python?
- What are different Perl Data Types?
- What are different types of interrupts?
- What are Different Types of Testing?
- What are the different types of psychotherapy?
- What are different types of eating disorders?
- What are the different types of ISDN?
- What are different types of finite automata?
- What are the different types of DBMS?