I am learning about Decorators in python and I stumbled upon this code:
def add(x, y):
return x+y
variable=add
print(id(add)) #returns some number 19080888
print(id(variable)) #returns the same number 19080888
print(id(add(1,2)) #returns some number 164680898
print(id(variable(1,2)) #returns different number 164680822
I can't wrap my head around it. Why is the id() of the functions the same, but that of their outputs, with the same arguments, different?
I tried looking on SO for a similar question but couldn't find one, hence had to ask it.