Created
May 3, 2011 17:39
-
-
Save a2chub/953795 to your computer and use it in GitHub Desktop.
This file contains 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
# coding:utf-8 | |
import sys | |
def Kaijo(num): | |
if num == 0: | |
return 1 | |
else: | |
return Kaijo(num -1) * num | |
if __name__ == '__main__': | |
if len(sys.argv) > 1: | |
if sys.argv[1].isdigit(): | |
k = int(sys.argv[1]) | |
sys.setrecursionlimit(k + 2) | |
print Kaijo(k) | |
else: | |
print 'number please' | |
else: | |
print 'number please' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment