Skip to content

Instantly share code, notes, and snippets.

@thien
Created December 4, 2016 21:09
Show Gist options
  • Save thien/e62669b6906439bc83d91fe27c09215f to your computer and use it in GitHub Desktop.
Save thien/e62669b6906439bc83d91fe27c09215f to your computer and use it in GitHub Desktop.
Fibonacci
def fib(n):
if n is 0:
return 0
if n is 1:
return 1
else:
return fib(n-1) + fib(n-2)
for i in range(0,10):
print(fib(i))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment