Skip to content

Instantly share code, notes, and snippets.

@abhi923
Created June 8, 2020 07:24
Show Gist options
  • Save abhi923/1f78b8cce1a1ae4e4f1bd25ffc275f83 to your computer and use it in GitHub Desktop.
Save abhi923/1f78b8cce1a1ae4e4f1bd25ffc275f83 to your computer and use it in GitHub Desktop.
def factorialFun(n):
if n < 0:
return None
if n < 2:
return 1
product = 1
for i in range(2, n + 1):
product *= i
return product
for n in range(1, 6): # testing
print(n, factorialFun(n))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment