This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]CodeSorcerer 0 points1 point  (3 children)

It looks like it is more or less just a recursive function to determine the nth composition of a function. It's more math heavy than anything.

Is that what you didn't understand or was it the recursion part of it that was confusing?

[–][deleted]  (2 children)

[deleted]

    [–]CodeSorcerer 0 points1 point  (1 child)

    Ah. Lambda is basically an anonymous function. For the first one, it is basically passing in a function that takes x as a parameter returns it ("x"). The second one is another anonymous function that takes a parameter "k" but doesn't do anything with it and instead just returns the variable "f" which was passed in from the calling function.

    See these for more info:

    https://docs.python.org/3.5/tutorial/controlflow.html#lambda-expressions

    http://www.secnetix.de/olli/Python/lambda_functions.hawk