#!/usr/bin/python3

# This is a Python program to display large factorials and test "fact.py".

import sys
import os
from math import factorial

def usage():
    print(f"""This program calculates large factorials.

Usage: {os.path.basename(sys.argv[0])} integer_expressions 

The integer expressions should be separated by spaces.
A factorial is the product of all positive integers <= a given integer.""")
    sys.exit(2)

if len(sys.argv)<2:
    usage()
else:
    for arg in sys.argv[1:]:
        print(f"factorial({arg}) = {factorial(int(arg))}")
