Skip to content

Instantly share code, notes, and snippets.

@adammenges
Created March 17, 2014 22:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adammenges/9610072 to your computer and use it in GitHub Desktop.
Save adammenges/9610072 to your computer and use it in GitHub Desktop.
nth fib
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