-
-def product(factors):
- """
- Returns the product of the elements in the list `factors`. If the
- list is empty, we return 1.
-
- TESTS:
-
- Normal integer multiplication::
-
- sage: product([1,2,3])
- 6
-
- And with symbolic variables::
-
- sage: x,y,z = SR.var('x,y,z')
- sage: product([x,y,z])
- x*y*z
-
- """
- return reduce(operator.mul, factors, 1)