• Identity operator, before going to identity operator let's have a small idea about its background.
  • We have multiple operators from them special operator is the one, in that special operator we are having two types of operators :
  • 1.Identity operator.
  • 2.Membership operator.
  • Now let's talk about the identity operator,
  • "Identity operator" is used to compare whether the value in the first argument may be or may not be the same in the second argument.
  • In identity operator we have two  types, they are:
  1. is
  2.  is not
  • "is" operator is used to saying that the value is present in the corresponding argument.
  • If the value is present in the corresponding argument then it returns True, else False.
  • is operator always checks the address comparison
  • "is not " operator is used to saying that the value is not present in the corresponding argument.
  • If the value not presents then it returns the True otherwise False.

Example: write a python program using is identity operator.

  1. a="apple"
  2. b="apple"
  3. print(a is b)
  4. True


#2.write a python program using isnot operator.

  1. a="Apple"
  2. b="apple"
  3. print(a isnot b)
  4. True









































Instance Of Java

We will help you in learning.Please leave your comments and suggestions in comment section. if you any doubts please use search box provided right side. Search there for answers thank you.
«
Next
Newer Post
»
Previous
Older Post

No comments

Leave a Reply

Select Menu