Created
December 17, 2009 05:16
-
-
Save yaotti/258541 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
#!/usr/bin/env python | |
# coding: utf-8 | |
def fact(x): | |
def factrec(f, n): | |
if n < 1: | |
return 1 | |
else: | |
return n * (f (f, (n - 1))) | |
return factrec(factrec, x) | |
print fact(5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment