Skip to content

Instantly share code, notes, and snippets.

@brockthebear
Created April 27, 2017 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brockthebear/69d164137afa387a23455d14d1f46384 to your computer and use it in GitHub Desktop.
Save brockthebear/69d164137afa387a23455d14d1f46384 to your computer and use it in GitHub Desktop.
n = int(input())
def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n-1)
print(factorial(n))
# As lambda function:
# factorial = lambda x : 1 if x<=1 else x*factorial(x-1)
# print(factorial(int(input())))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment