- Code: Select all
>>> def make_incrementor(n):
... return lambda x: x + n
>>> f = make_incrementor(42)
How does the x come in to the f part? Is there some sort of metaprocess that I'm missing?
My best guess is that when you define the function f as make_incrementor(42), you run the lambda as f. Is that right?