prod(iterable, *, start=1);
iterable – The elements of the iterable whose product is computed by the function.
start – The starting value of the product.
The product of the elements from the iterable.
- The function prod() finds the product of the elements from the given iterable.
- The function accepts a starting value of the product through the parameter start, which is multiplied with the first element of the iterable.
# Example Python program to find the product of elements from an iterable
# A python tuple
sequence = (1, 1.2, 2, 2.2, 3, 3.2);
# Find the product of the elements of the tuple with the starting product value as 4
product = math.prod(sequence, start=4);