Last active
April 25, 2019 14:32
-
-
Save nickyfoto/ab0c44c9d96ecee7b4c91bec13d7e1c5 to your computer and use it in GitHub Desktop.
Recursively calculate nth Fibonacci number
This file contains hidden or 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 fibR(n): | |
"""recursive fib""" | |
if n == 0: | |
return 0 | |
if n == 1: | |
return 1 | |
return fibR(n-1) + fibR(n-2) | |
fibR(25) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment