I know that the operators is and is not test for object identity: x is y is true if and only if x and y are the same object
I initialize two variables
iandjwith the same value10, and when I am comparing theidof both variable withisoperator it gives me aFalseeven though theid(i)andid(j)are the same.
I need a clarification, Here is my code
>>> i = 10;
>>> j = 10;
>>> print(10==10);
True
>>> print(id(10)==id(10));
True
>>> print(10 is 10);
True
>>> print(5+5 is 10);
True
>>> print(i == j);
True
>>> print(id(i) == id(j));
True
>>> print(i is j);
True
>>> print(id(i) is id(j)); # Why this statment Evaluate to False this is my quetion?
False
>>> id(i);
140718000878704
>>> id(j);
140718000878704