Created
July 3, 2016 21:26
-
-
Save konstantinfarrell/d4f3203c2bae4ef95a2ecfb1ea83702f 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
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