I was working with DataStructures Lab. and I found out that:
a = 2
b = 2
print(id(a)) #1632496144
print(id(b)) #1632496144
Both a and b variables have same id but, when I did this
x = 500
y = 500
print(id(x),id(y))
it's written here that if the range will exceed from -3 to 256, it will give different memory locations.
My question is that why these IDE's are giving different results?
In JUPYTER NOTEBOOK the output is this:
2999875658288 2999875658256
different memory locations
while In VS CODE the output is this:
1495642916912 1495642916912
same memory locations