# file: quadratic-equation.py def main(): print "This program solves a quadratic equation ax^2+bx+c=0 for the given coefficients a,b,c." a,b,c = input("Please, input the coefficients (a,b,c):") import math discr_root=math.sqrt(b*b-4*a*c) root1=(-b+discr_root)/(2*a) root2=(-b-discr_root)/(2*a) print "The solutions of the quadratic equation ", a,"x^2 +",b,"x +",c,"= 0 are:" print root1, ", ", root2 main()