Its a little unclear what you want to consider the variables to be.
Why would the coefficient list have 6 items?  Perhaps you want
something like this:

var('a,b,c,d,e,f,x')
l=[a+b*x+c*x^2, d+e*x+f*x^2
for s in range(0,2):
    cofs = [l[s].coefficient(q) for q in [a,b,c,d,e,f]]
    print cofs

...but I can't tell for sure.

-M. Hampton

On Sep 2, 11:12 am, andrew ewart <[email protected]> wrote:
> suppose i have a list of the form
> l=[a+b*x+c*x^2, d+e*x+f*x^2]
> how do i use l[n].list() correctly to produce
> [a,b,c,d,e,f]
> as at the moment im only getting
> [a,b,c] then getting an error of list index out of range
> code would be
> for n in xrange(0,6):
>         for ja in range(0,2):
>         el=l[ja].coeffs()
>         print el
>         ell=el[n].list()
>         print ell

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to