I was learning the concept of decorators in python from the following link :
http://www.python-course.eu/python3_decorators.php
I have a basic doubt for the following code snippet in it :
def f(x):
def g(y):
return y + x + 3
return g
nf1 = f(1)
nf2 = f(3)
print(nf1(1))
print(nf2(1))
In this page , it is written that the outputs of the last two lines are going to be '5' and '7' respectively . But as I can see we are only passing the value for 'x' , where does it get the value for 'y' from ? How does it assign value to 'Y' to calculate the output ?