Anyone Can Code.
Identity operators are used to check whether two objects are identical.
There are two identity operators: is
and is not
. It's pretty
self-explanatory what these two do. is
checks whether two objects are identitcal
while is not
checks whether two objects are not the same.
x = 6 y = 5 print(x is not y) y = 6 print(x is y)
True True
That's it for this tutorial! Click Next to access the next tutorial!
This site uses cookies to improve your experience as well as for site metrics. To see more, check out our Privacy Policy