{"conversations": [{"from": "user", "value": "Programa en Python una funci\u00f3 que serveixi per calcular equacions de segon grau"}, {"from": "assistant", "value": "\u00c9s clar, la forma m\u00e9s comuna de resoldre equacions de segon grau \u00e9s aplicant la Formula de Bhaskara o coneguda tamb\u00e9 com la Formula General. L' implementaci\u00f3 d' una funci\u00f3 en Python seria de la seg\u00fcent forma: def equacion_ segundo_ grat( a, b, c): x1 = 0 x2 = 0 discriminant = (b * 2) - (4 * a * c) raiz_ discriminant = cmath. sqrt( discrinant) x1 = (-b + raiz_ discriminant) /( 2 * a) x2 = (- b - raiz_ discriminant) /( 2 * a) return x1, x2"}]}