| 1 | initial version |
It is simply
sage: prod(S)
6
You cannot index S because it is not ordered; you would have to convert to a list first e.g. by list(S).
The elements of S are of type Integer and so prod will use the product of integers.
When you add to S a complex number element like 1+I which is of type Expression, the Integers will be coerced to Expressions, the product will work in the way you expect and the result will be an Expression.
| 2 | No.2 Revision |
It is simply
sage: prod(S)
6
You cannot index S because it is not ordered; you would have to convert to a list first e.g. by s = list(S).
The elements of S are of type Integer and so prod will use the product of integers.
When you add to S a complex number element like 1+I which is of type Expression, the Integers will be coerced to Expressions, the product will work in the way you expect and the result will be an Expression.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.