First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 9 years ago

fidbc gravatar image

It seems like the solution dictionary does not contain an entry for x. If you inspect the solution dictionary before printing, you can see that the keys are x + x2, (x - 1)*(x - 2) + (y - 3)*(y - 4), (x2 - 1)*(x2 - 2) + (y2 - 3)*(y2 - 4) and y + y2. To print the solutions (independently of what is returned in the dictionaries) you can try

for soln in sols:
    for varbl in soln:
        print "{0} : {1},".format(varbl, soln[varbl])