Skip to content

Instantly share code, notes, and snippets.

@ParthKolekar
Last active June 7, 2016 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ParthKolekar/5586db04e1e345cbd7eae335064d9a9a to your computer and use it in GitHub Desktop.
Save ParthKolekar/5586db04e1e345cbd7eae335064d9a9a to your computer and use it in GitHub Desktop.
One liner recursive fibonacci in python
def fibonacci(n): return 1 if not n or not n - 1 else fibonacci(n - 1) + fibonacci(n - 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment