On this page
  1. math.factorial
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

math.factorial

Prev: math.fabs | Up: math | Next: math.floor
Rel: math.acos, math.acosh, math.asin, math.asinh
Ref: docs.python.org — math.factorial
Tags: #public #python3 #stdlib #math


Import

import math
from math import factorial

Signature & Overview

math.factorial(n, /)

Find n!.

Usage

import math

assert math.factorial(5) == 120
assert math.factorial(0) == 1

Gotchas

REPL Inspect

from math import factorial
help(factorial)

Linked from

Related notes