Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 511 Bytes

File metadata and controls

22 lines (17 loc) · 511 Bytes

Factorial

  • The factorial of a non-negative integer n is the product of all positive integers less than or equal to n. It is denoted as n!.

Mathematical Definition

  • n! = n × (n - 1) × (n - 2) × ... × 1
  • Special case: 0! = 1 (by definition)

Examples:

  • 5! = 5 × 4 × 3 × 2 × 1 = 120
  • 3! = 3 × 2 × 1 = 6
  • 0! = 1

Python Solution

Running

  • Running with an instance included:
    python instance.py