def main(): print "This program solves the quadratic equation. In case there are no real number solutions it prints out a warning" try: import math a,b,c = input("Please, input the coefficients of quadratic equation (a,b,c):") discrRoot = math.sqrt(b*b-4*a*c) root1=(-b+discrRoot)/(2*a) root2=(-b-discrRoot)/(2*a) print "The roots of the quadratic equation ", a,"x^2 + ",b,"x + ",c," are: ", root1,", ",root2 except ValueError: print "No real roots" main()