I have a simple code I stumbled upon on HyperSkill and was testing it on the Python console, both Python2 and Python3. The results confused me.
>>> a = 5
>>> b = 5
>>> a == b
True
>>> a is b
True
>>> x = 1000
>>> y = 1000
>>> x == y
True
>>> x is y
False
>>>
I don't understand why the result of a is b
is True
and yet the result of x is y
is (as expected) False