Created
January 28, 2018 19:36
-
-
Save abatilo/7735deeeff24aa6ef4668a071dc31f1e 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
def fib(n): | |
if n == 0: | |
return 0 | |
if n == 1: | |
return 1 | |
return fib(n - 1) + fib(n - 2) | |
if __name__ == '__main__': | |
for _ in range(10): | |
print fib(_) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment