Created
February 23, 2020 23:42
-
-
Save edenau/ebeaf8e068b17cd7a624b9d843db3bd3 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 fibo(n): | |
assert n >= 0 and int(n) == n, 'Fibonacci number is defined for non-negative indices only!' | |
if n in [0,1]: | |
return n | |
else: | |
return fibo(n-1) + fibo(n-2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment