First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Or you can set the solution_dict to True:

sage: solve(qe, x, solution_dict=True)
[{x: 379}, {x: 239}]
sage: solve(qe, x, solution_dict=True)[0][x]
379
sage: solve(qe, x, solution_dict=True)[1][x]
239

Vincent

click to hide/show revision 2
No.2 Revision

Or you can set the solution_dict to True:

sage: solve(qe, x, solution_dict=True)
[{x: 379}, {x: 239}]
sage: solve(qe, x, solution_dict=True)[0][x]
379
sage: solve(qe, x, solution_dict=True)[1][x]
239

EDIT: as mentioned in comments, the output are not integers but element of the symbolic ring. In order to get integers the fastest is

sage: a = solve(qe, x, solution_dict=True)[0][x]
sage: a.pyobject()
379

Vincent