Skip to content

Instantly share code, notes, and snippets.

@pmalek
Created July 15, 2016 19:35
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 pmalek/22e31129d11bb09acd3ab1a8dcfef47e to your computer and use it in GitHub Desktop.
Save pmalek/22e31129d11bb09acd3ab1a8dcfef47e to your computer and use it in GitHub Desktop.
python fibonacci
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