Identity Operators (is, is not)

 References: 

https://www.youtube.com/watch?v=qtTs03rI7W0

https://www.geeksforgeeks.org/python/difference-between-and-is-not-operator-in-python/

  • In this article, we are going to see != (Not equal) operators. 
  • In Python != is defined as not equal to operator. 
  • It returns True if operands on either side are not equal to each other, and returns False if they are equal. 
  • Whereas is not operator checks whether id() of two objects is same or not
  • If same, it returns False and if not same, it returns True. And is not operator returns True if operands on either side are not equal to each other, and returns false if they are equal.

Example

Comments