Created
June 9, 2016 22:28
-
-
Save lukehinds/63d9cb5ac2656e613f54ff74ff913706 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lambda is just a fancy way of saying function. Other than its name, there is nothing obscure, intimidating or cryptic about it. When you read the following line, replace lambda by function in your mind: | |
>>> f = lambda x: x + 1 | |
>>> f(3) | |
4 | |
It just defines a function of x. Some other languages, like R, say it explicitly: | |
> f = function(x) { x + 1 } | |
> f(3) | |
4 | |
You see? It's one of the most natural things to do in programming. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment