Last active
October 22, 2018 17:10
-
-
Save zeakd/d8395a0ca427bbcb34319f777417de2c to your computer and use it in GitHub Desktop.
Example to explain the shape of arrow funciton
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
data = [...] | |
# without lambda | |
def square_plus_one(x): | |
return x * x + 1 | |
map(square_plus_one, data) | |
# with lambda | |
map(lambda x: x * x + 1, data) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment