The cmath.sqrt() function from cmath module can find square root of any number.The sqrt() function from math module can only find the square root of positive numbers.A Python program to solve quadratic equation can be written using the sqrt() function in math and cmath module.
where 'a', 'b' and 'c' are just numbers They are the 'numerical modules' of the square equation they have given you to solve.
The quadratic formula uses 'a', 'b' and 'c' from. In this program, you will learn how to calculate the roots of a square equation when the coefficients a, b and c are known.
When the Value of discriminant is greater than 0 then there exist two complex roots for the quadratic equation. Python Program to Solve Quadratic equation. When the Value of discriminant is equal to 0 then there exist two equal roots for the quadratic equation. Which can be calculated using the above roots formula. When the Value of discriminant is greater than 0 then there exist two distinct roots for the quadratic equation 2)Discriminant value Discriminant = b ^ 2 - 4 * a *cīased on the value of discriminant there are three types of roots for Quadratic Equation 3)Calculating roots of Quadratic Equation roots = ( -b + sqrt(b ^ 2 - 4 * a *c) ) / (2 * a), ( -b - sqrt(b ^ 2 - 4 * a *c) ) / (2 * a) Where x is an unknown variable and the numerical coefficients a, b, c. Quadratics or quadratic equations are polynomial equations of the second degree, which means that they contain at least one squared word.