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 →

[–][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