Created
October 1, 2018 17:39
-
-
Save ram0973/5772318073a27c7302d7f76a06072621 to your computer and use it in GitHub Desktop.
Fibonacci in python
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(n): | |
if n < 2: | |
return n | |
return fib(n - 2) + fib(n - 1) | |
for i in range(1,30): | |
print(fib(i)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment