You're probably getting a list of dictionaries:

sage: var("x y")
(x, y)
sage: sols = solve([x^2-4==0, y^2-9==0], x, y, solution_dict=True)
sage: sols
[{y: -3, x: -2}, {y: -3, x: 2}, {y: 3, x: -2}, {y: 3, x: 2}]

This is just like any other list -- the fact the elements happen to be
dictionaries doesn't change anything -- and can be looped over and
indexed.  For example:

sage: sols[0]
{y: -3, x: -2}
sage: sols[0][x]
-2
sage: sols[0][y]
-3
sage: sols[1][x]
2
sage: sols[1][y]
-3
sage: sum(sol[x]+sol[y] for sol in sols)
0

etc.


Doug

-- 
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