def make(label):
def echo(message):
print(label + ':' + message)
return echo
F = make('Spam')
F('Ham!')
Spam:Ham!
My doubt here is that when make
function exited, it returned the address of echo
function. And now when we call echo
function it still knows the label
value. Since there is no label
variable after make
function exited. How did the echo
function knows label value?