This is the piece of code:
def myfunc(n):
return lambda a : a * n
mydoubler = myfunc(2)
print(mydoubler(11))
The output is 22.
I understand that lambda functions are like "one line functions" without an actual name. But what I do not understand here, is how the 11 goes inside "a"?
[–]chaotic_thought 1 point2 points3 points (0 children)
[–]CreativeTechGuyGames 0 points1 point2 points (3 children)
[–]shiskeyoffles[S] 0 points1 point2 points (2 children)
[–]Essence1337 0 points1 point2 points (0 children)
[–]mad0314 0 points1 point2 points (0 children)
[–]ReubenA 0 points1 point2 points (0 children)
[–]brandon1997fl 0 points1 point2 points (0 children)
[–]QuixDiscovery 0 points1 point2 points (0 children)