quadratic py import math def main()print("this program finds the real solutions to quadratic\ "abc eval(input("please enter the coefficients (abc)")discrim if discrim > discroot math sqrt(discrimroot (- discroot( aroot (- discroot( aprint("\nthe solutions are:"root root main(this version first computes the value of the discriminant ( acand then checks to make sure it is not negative only then does the program proceed to take the square root and calculate the solutions this program will never attempt to call math sqrt when discrim is negative unfortunatelythis updated version is not really complete solution study the program for moment what happens when the equation has no real rootsaccording to the semantics for simple ifwhen * * * is less than zerothe program will simply skip the calculations and go to the next statement since there is no next statementthe program just quits here' what happens in an interactive sessionquadratic main(this program finds the real solutions to quadratic please enter the coefficients (abc) , , this is almost worse than the previous versionbecause it does not give users any indication of what went wrongit just leaves them hanging better program would print message telling users that their particular equation has no real solutions we could accomplish this by adding another simple decision at the end of the program if discrim print("the equation has no real roots!"this will certainly solve our problembut this solution just doesn' feel right we have programmed sequence of two decisionsbut the two outcomes are mutually exclusive if discrim > is true then discrim must be false and vice versa we have two conditions in the programbut there is really only one decision to make based on the value of discrim the program