1 2 3 4 5 6 7 8
def prod(iterator): """ Compute the product of the values in the iterator. - Empty product is 1.""" p = 1 for x in iterator: p *= x return p
You can clone a snippet to your computer for local editing. Learn more.