Skip to content

Instantly share code, notes, and snippets.

@konstantinfarrell
Created July 3, 2016 21:26
Show Gist options
  • Save konstantinfarrell/d4f3203c2bae4ef95a2ecfb1ea83702f to your computer and use it in GitHub Desktop.
Save konstantinfarrell/d4f3203c2bae4ef95a2ecfb1ea83702f to your computer and use it in GitHub Desktop.
import os
def fibonnacci(num):
"""
Takes a number num and returns the num'th fibonnacci number.
"""
if num == 2 or num == 1:
return 1
else:
fib = fibonnacci(num-1) + fibonnacci(num-2)
return fib
for i in range(1, 21):
print(fibonnacci(i))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment