Python caches small integers between -5 and 256 for performance. So a and b point to the same object. But x and y are different objects, even though they have the same value.
This is part of Python's internal optimization. It’s not about math. it’s about memory references under the hood.
Bottom Line?
Use == when you care about value, not identity.
print(x == y) # True ✅Because sometimes
is isn’t what you think it is 😉
