Program:
a = 5
b = 5
print(a == b)
print(id(a) == id(b))
Output:
True
True
I understand the first line of the output should be True, but why is the second line also True? Doesn't the operator id() spit out the memory location? Does the constant 5 get a specific memory location when it is used in the program?
Also, if that is the case, how can we return the memory location of the variables a and b?