Consider the below code.
x = 10
y = 10
print(id(x))
print(id(y))
Output:
140710803641440
140710803641440
Now, give same values outside the range [-5,256]
x = 257
y = 257
print(id(x))
print(id(y))
Output:
2366730643376
2366730642864
Consider the below code.
x = 10
y = 10
print(id(x))
print(id(y))
Output:
140710803641440
140710803641440
Now, give same values outside the range [-5,256]
x = 257
y = 257
print(id(x))
print(id(y))
Output:
2366730643376
2366730642864