- The factorial of a non-negative integer
nis the product of all positive integers less than or equal ton. It is denoted asn!.
n! = n × (n - 1) × (n - 2) × ... × 1- Special case:
0! = 1(by definition)
Examples:
5! = 5 × 4 × 3 × 2 × 1 = 1203! = 3 × 2 × 1 = 60! = 1
- Running with an instance included:
python instance.py