Created
August 14, 2014 07:15
-
-
Save hyonschu/ff26422c4eecc9956165 to your computer and use it in GitHub Desktop.
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(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