Problem Statement
Why do small integers often appear to have the same id in Python sessions?
Explanation
Implementations like CPython cache a range of small integers to reduce allocations. This makes repeated small numbers share the same identity.
It is an implementation detail, not a language guarantee. Do not rely on it for program logic.
Code Solution
SolutionRead Only
a=5; b=5 print(id(a)==id(b)) # often True
