Skip to content

Instantly share code, notes, and snippets.

@tebeka
Created May 29, 2009 21:49
Show Gist options
  • Save tebeka/120230 to your computer and use it in GitHub Desktop.
Save tebeka/120230 to your computer and use it in GitHub Desktop.
#!/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