s=b*b-4*a*c if not isinstance(a+b+c,(int,float)): raise TypeError('wrong operand type') if a==0: return -c/b elif s<0: return None elif s==0: return -b/2*a else: return (-b+math.sqrt(s))/(2*a), (-b-math.sqrt(s))/(2*a)
Sign in to make a reply
Vincent_胡小金