Created
May 29, 2009 21:49
-
-
Save tebeka/120230 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
#!/usr/bin/env python | |
def fact(n): | |
r = 1 | |
while n > 1: | |
r *= n | |
n -= 1 | |
return r | |
from sys import argv | |
if len(argv) != 2: | |
raise SystemExit("usage: fact.py NUMBER") | |
print fact(int(argv[1])) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment