Java, .NET, PHP, PYTHON, ANGULAR, .NET, ML, Data Scince, 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 we 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 the same address then it return true otherwise return false?

x = [1,2,3]
y = [1,2,3]
if x is y:
   print("equall")
else:
   print("not equall")

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")





Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post