Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardPythonidentity vs equalitySingle-choice MCQ

Why does CPython return the same object for `a` and `b` here, yet `c is d` is False, despite all four holding equal-valued ints?

a = 256 b = 256 c = 257 d = 257 print(a is b, c is d)