Except mine is cooler
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

factorial.py 197 B

1234567891011121314
  1. import sys
  2. def factorial(n):
  3. if n == 0:
  4. return 1
  5. else:
  6. return n * factorial(n-1)
  7. def main():
  8. n = int(sys.argv[1])
  9. print(factorial(n))
  10. if __name__ == '__main__':
  11. main()