Created
July 15, 2016 19:35
-
-
Save pmalek/22e31129d11bb09acd3ab1a8dcfef47e to your computer and use it in GitHub Desktop.
python fibonacci
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_to(n): | |
fibs = [0, 1] | |
for i in range(2, n+1): | |
fibs.append(fibs[-1] + fibs[-2]) | |
return fibs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment