Skip to content

Instantly share code, notes, and snippets.

@Ikhiloya
Created October 25, 2018 22:42
Show Gist options
  • Save Ikhiloya/5dbddbdbe018ad1811da52d63c2cc701 to your computer and use it in GitHub Desktop.
Save Ikhiloya/5dbddbdbe018ad1811da52d63c2cc701 to your computer and use it in GitHub Desktop.
A simple function that computes the factorial of a number
def factorial(x):
fact = 1
for i in range(x):
fact *= i + 1
return fact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment