Math Functions

math.prod()

Multiply iterable elements starting from start (one by default). An empty iterable returns start. Intended for numeric values.

Formal Syntax & Structure

python syntaxpython
math.prod(iterable, /, *, start=1)

Parameters & Attributes

NameTypeDescription
iterableiterable of numbersValues to accumulate.
startnumberInitial product value.

Return Value

number

Numeric result; concrete type depends on inputs.

Working Example

Example Snippetpython
import mathprint(math.prod([2, 3, 4]))
Python Reference