import math from math import sqrt print "These are the zeroes of a secong grade polynomial" a=float(raw_input("Type a =")) b=float(raw_input("Type b =")) c=float(raw_input("Type c =")) aux=b*b-4*a*c; if aux>0: x1=(-b+sqrt(aux))/(2*a) x2=(-b-sqrt(aux))/(2*a) print "x1= " , x1 ,", x2=" ,x2 elif aux==0: print "x= " , -b/(2*a) else: x1=sqrt(-aux)/(2*a) x2=-b/(2*a) print "x1= " , x2 , "+" , x1 , "j, x2=" , x2 , "-" , x1 , "j"