Python Sympy solve returns list vs. dictionary

Viewed 493

I am using sympy and its solve function, but I noticed that it sometimes returns a dictionary in a list but in other cases just a dictionary, without a list.

from sympy import * 
x, y = symbols('x y')
q = 16*x**0.5*y**0.5
solve((diff(q, x)/5 - diff(q, y)/20, 3200 - q))

This returns a list: [{x: 400.000000000000, y: 100.000000000000}]

x, y = symbols('x y')
q = 8*x**.5*y**0.5
solve((diff(q, x)/10 - diff(q, y)/8, 400-10*x-8*y))

This returns a dictionary, without a list: {x: 20.0000000000000, y: 25.0000000000000}

Why does this happen? Thank you for your help.

0 Answers
Related