Source code for fibonacci.fibonacci
[docs]def fib(n):
"""Return the n-th Fibonacci number."""
if n == 0:
return 0
elif n == 1:
return 1
else:
return fib(n-2) + fib(n-1)
[docs]def fib(n):
"""Return the n-th Fibonacci number."""
if n == 0:
return 0
elif n == 1:
return 1
else:
return fib(n-2) + fib(n-1)