Created
June 15, 2012 19:55
-
-
Save jasonLaster/2938425 to your computer and use it in GitHub Desktop.
CodeStack -- Factorial Example
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
# dumb recursive factorial | |
def fact(n): | |
if (n <= 1): | |
return 1 | |
else: | |
return n * fact(n - 1) | |
print fact(6) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment