Live Engine
Select Topic
easyDatatypes And Keywords
A developer writes the following and is surprised by the output. What does it reveal about how Python stores small integers?
Code
a = 256
b = 256
print(a is b)
x = 257
y = 257
print(x is y)a = 256
b = 256
print(a is b)
x = 257
y = 257
print(x is y)