Created
July 1, 2015 00:31
-
-
Save Veedrac/91f47e67ea0459564d04 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 fibonacci(n): | |
if n == 0: | |
return 0 | |
elif n == 1: | |
return 1 | |
else: | |
return fibonacci(n - 1) + fibonacci(n - 2) | |
def fibonacci(n): | |
if n == 0: | |
return 0 | |
elif n == 1: | |
return 1 | |
else: | |
ret = 0 | |
ret += fibonacci(n - 1) | |
ret += fibonacci(n - 2) | |
return ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment