Created
October 25, 2018 22:42
-
-
Save Ikhiloya/5dbddbdbe018ad1811da52d63c2cc701 to your computer and use it in GitHub Desktop.
A simple function that computes the factorial of a number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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