Function Name:
prod
Signature:
prod(iterable, *, start=1);
Parameters:
iterable – The elements of the iterable whose product is computed by the function.
start – The starting value of the product.
Return Value:
The product of the elements from the iterable.
Overview:
- 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:
# Example Python program to find the product of elements from an iterable import math
# 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);
print("Product:"); print(product); |
Output:
Product: 202.752 |