Last active
September 13, 2021 19:20
-
-
Save chrisbodhi/c520bb6d9ad7185436f9f99cf5a3966f to your computer and use it in GitHub Desktop.
"Recursion is the GOTO of functional programming." -- Erik Meijer
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
# "Recursion is the GOTO of functional programming." -- Erik Meijer | |
def fact(n): | |
return reduce(lambda x, y: x * y, range(1, n + 1)) | |
print(fact(5)) | |
# => 120 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment