Skip to content

Instantly share code, notes, and snippets.

@yvan-sraka
Created October 21, 2016 09:47
Show Gist options
  • Save yvan-sraka/70fc13d34f673c80a574ad4f6363fc84 to your computer and use it in GitHub Desktop.
Save yvan-sraka/70fc13d34f673c80a574ad4f6363fc84 to your computer and use it in GitHub Desktop.
# fac(1) = 1
# fac(n) = n * fac(n - 1)
def fac(n):
if n == 1:
return 1
return n * fac(n-1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment