
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 does 'is not' operator do in Python?
In Python, is and is not operators are called identity operators. Each object in computer's memory is assigned a unique identification number (id) by Python interpreter. Identity operators check if id() of two objects is same. 'is not' operator returns true of id() values are different and false if they are same.
>>> a=10 >>> b=a >>> id(a), id(b) (490067904, 490067904) >>> a is not b False >>> a=10 >>> b=20 >>> id(a), id(b) (490067904, 490068064) >>> a is not b True
- Related Questions & Answers
- What does 'not in' operator do in Python?
- What does 'is' operator do in Python?
- What does 'in' operator do in Python?
- What does colon ':' operator do in Python?
- What does '?' do in C/C++?
- What does 'weight' do in tkinter?
- What does the '@' prefix do in PHP?
- What does 'by' keyword do in Kotlin?
- What is 'delete' Operator in JavaScript?
- What is 'new' Operator in JavaScript?
- What is 'void' Operator in JavaScript?
- What does 'show processlist' command do in MySQL?
- How to do string concatenation without '+' operator in Python?
- What does the 'b' modifier do when a file is opened using Python?
- What does the 'U' modifier do when a file is opened using Python?
Advertisements