Skip to content

Instantly share code, notes, and snippets.

@koji
Created March 12, 2020 07:02
Show Gist options
  • Save koji/6ef12a3f238f47161828ef37a799dfc3 to your computer and use it in GitHub Desktop.
Save koji/6ef12a3f238f47161828ef37a799dfc3 to your computer and use it in GitHub Desktop.
factorial in python
def factorial(n):
    if n > 1:
        return n * factorial(n-1)
    else:
        return 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment