# Revision history [back]

### why sage does find problems when calculating with objects put in a list ?

from sage.rings.quotient_ring import is_QuotientRing F=ZZ.quo(3*ZZ);F A.<x,y,z>=PolynomialRing(F);A I=ideal(X^2-1,Y^2-1,Z^2-1);I R.<x,y,z> = A.quotient_ring(I);R

### why sage does find problems when calculating with objects put in a list ?

from sage.rings.quotient_ring import is_QuotientRing F=ZZ.quo(3*ZZ);F A.<x,y,z>=PolynomialRing(F);A I=ideal(X^2-1,Y^2-1,Z^2-1);I R.<x,y,z> = A.quotient_ring(I);R

### why sage does find problems when calculating with objects put in a list ?

from sage.rings.quotient_ring import is_QuotientRing F=ZZ.quo(3*ZZ);F A.<x,y,z>=PolynomialRing(F);A I=ideal(X^2-1,Y^2-1,Z^2-1);I R.<x,y,z> = A.quotient_ring(I);Rdef vbl(l,ex): ....: #li=liste de variables ....: #ex=liste d'entiers naturels de même longueur que li ....: n=len(l) ....: V=1 ....: for i in range(n): ....: V=V[l[i]*ex[i]] ....: return V

### why sage does find problems when calculating with objects put in a list ?

def vbl(l,ex): ....: vbl(c,ex): #li=liste de variables ....: l=len(c) #ex=liste d'entiers naturels de même longueur que li ....: n=len(l) ....: V=1 ....: V=1 for i in range(n): ....: V=V[l[i][c[i]*ex[i]] ....: return V

### why sage does find problems when calculating with objects put in a list ?

def vbl(c,ex): l=len(c) V=1 for i in range(n): V=V[c[i]*ex[i]] return V

### why sage does find problems when calculating with objects put in a list ?

def vbl(c,ex): l=len(c) V=1 for i in range(n): V=V[c[i]*ex[i]] return V

 7 None Emmanuel Charpentier 7002 ●6 ●46 ●136

### why sage does Sage find problems when calculating with objects put in a list ?

def vbl(c,ex): l=len(c) V=1 for i in range(n): V=V[c[i]*ex[i]] return V

 8 None Emmanuel Charpentier 7002 ●6 ●46 ●136

### why does Sage find problems when calculating with objects put in a list ?

def vbl(c,ex): l=len(c) V=1 for i in range(n): V=V[c[i]*ex[i]] return V

 9 None Emmanuel Charpentier 7002 ●6 ●46 ●136

### why does Sage find problems when calculating with objects put in a list ?

def vbl(c,ex): l=len(c) V=1 for i in range(n): V=V[c[i]*ex[i]] return V

 10 None Emmanuel Charpentier 7002 ●6 ●46 ●136

### why does Sage find problems when calculating with objects put in a list ?

Consider:

def vbl(c,ex): l=len(c) V=1 for i in range(n): V=V[c[i]*ex[i]] return V

.

 11 None Emmanuel Charpentier 7002 ●6 ●46 ●136

### why does Sage find problems when calculating with objects put in a list ?

Consider:.

def vbl(c,ex):
l=len(c)
V=1
for i in range(n):
V=V[c[i]*ex[i]]
V=V*[c[i]**ex[i]]
return VV


.

 12 None slelievre 17634 ●22 ●159 ●348 http://carva.org/samue...

### why does Sage find problems when calculating with objects put in a list ?

.I define the following function:

def vbl(c,ex):
vbl(c, ex):
l = len(c)
l=len(c)
V=1 V = 1       for i in range(n):
V=V*[c[i]**ex[i]]
V = V * [c[i]**ex[i]]
return V


.I then compute

 sage: vbl(['x, y, z'], [2, 3, 4])


expecting to get

x^2**y^3**z^4


TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'

Yet I can compute x^2, y^3 and z^4 after declaring x, y and z as variables:
sage: var('x, y, z')