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
| Name | Type | Description |
|---|---|---|
| iterable | iterable of numbers | Values to accumulate. |
| start | number | Initial product value. |
Return Value
number
Numeric result; concrete type depends on inputs.
Working Example
Example Snippetpython
import mathprint(math.prod([2, 3, 4]))