Skip to content

Instantly share code, notes, and snippets.

@tsmacdonald
Last active August 29, 2015 14:00
Show Gist options
  • Save tsmacdonald/11389511 to your computer and use it in GitHub Desktop.
Save tsmacdonald/11389511 to your computer and use it in GitHub Desktop.
def fib(n, i=1, a=0, b=1):
if i == n: return b
return fib(n, i + 1, b, a + b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment