Created
April 27, 2017 19:57
-
-
Save brockthebear/69d164137afa387a23455d14d1f46384 to your computer and use it in GitHub Desktop.
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
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