def quadratic(a,b,c) :
try :
if not isinstance(a+b+c,int): raise TypeError('param must be int')
except TypeError as e :
raise e
if a == 0 :
raise ValueError('The coefficient of quadratic term cannot be zero')
r = bb - 4ac
if r < 0 :
return
sqrt_r = math.sqrt(r)
return (-b+sqrt_r) / (2a), (-b - sqrt_r) / (2*a)
wxg122_858
import math
def quadratic(a,b,c) : try : if not isinstance(a+b+c,int): raise TypeError('param must be int') except TypeError as e : raise e if a == 0 : raise ValueError('The coefficient of quadratic term cannot be zero') r = bb - 4ac if r < 0 : return sqrt_r = math.sqrt(r) return (-b+sqrt_r) / (2a), (-b - sqrt_r) / (2*a)