Skip to content

Instantly share code, notes, and snippets.

@hyonschu
Created August 14, 2014 07:15
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 hyonschu/ff26422c4eecc9956165 to your computer and use it in GitHub Desktop.
Save hyonschu/ff26422c4eecc9956165 to your computer and use it in GitHub Desktop.
def fib(length):
first, second = 1, 1
if length < 2:
return length
else:
length -= 2
for i in range(length):
second, first = first+second, second
return second
%timeit -n 20 fib(10000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment