Created
March 17, 2014 22:54
-
-
Save adammenges/9610072 to your computer and use it in GitHub Desktop.
nth fib
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
def fib(n): | |
return reduce(lambda x, y: [x[1], x[0] + x[1]], xrange(n-2), [0, 1])[1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment