Skip to content

Instantly share code, notes, and snippets.

@Joel-hanson
Last active April 10, 2021 17:36
Show Gist options
  • Save Joel-hanson/a5bffde7fe944944eecab9673b098c5b to your computer and use it in GitHub Desktop.
Save Joel-hanson/a5bffde7fe944944eecab9673b098c5b to your computer and use it in GitHub Desktop.
Find nth Fibonacci number using recursion.
def fibonacci(n):
if n <= 2:
return 1
return fibonacci(n - 1) + fibonacci(n - 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment