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 Integer
s will be coerced to Expression
s, 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 Integer
s will be coerced to Expression
s, the product will work in the way you expect and the result will be an Expression
.