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