Java, .NET, PHP, PYTHON, ANGULAR, ML, Data Science, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"

is, is not an operator and in, not in operator in LIST in Python


How to use is, is not and in, not in operator in LIST:-

"Is" the operator is used to compare the address of the list variable, tuple, set, and dictionary, if they point to the same address then it returns true otherwise returns false?

x = [1,2,3]
y = [1,2,3]

if x is y:
   print("equall")
else:
   print("not equall")

o/p not equal





Is not operator is opposite of Is operator.


In operator is used to check that element is exists or not in List, Tuple, Dictionary, and Set type variable.

 Example of In Operator:-

x = [1,2,3,4,5]

if 21 in x:

   print("exist")

else:

   print("not exist")





2 Comments

POST Answer of Questions and ASK to Doubt

  1. Q:- Implementation of "is" in Pythone Program ?
    Solution:-
    a= ["Computer", "Laptop", "Android", "iPhone","Windows"]

    if "Linux" in a:

    print("It is Presented in List.")

    else:

    print("It is Not Presented in List.")

    ReplyDelete
  2. Program of IS operator--->

    y=["Python","Java","C","C++","VB"]
    if ".Net" in y:
    print("it is there")
    else:
    print("it is not there")

    ReplyDelete

Post a Comment

POST Answer of Questions and ASK to Doubt

Previous Post Next Post