if not isinstance(a,(int,float)) and not isinstance(b,(int,float)) and not isinstance(c,(int,float)) and a!=0:
raise TypeError('bad operand type')
if b**2 - 4*a*c < 0:
return
else:
x = (-b + math.sqrt(b**2 - 4*a*c))/(2*a)
y = (-b - math.sqrt(b**2 - 4*a*c))/(2*a)
return x,y
Sign in to make a reply
爱上树的椰子蟹
if not isinstance(a,(int,float)) and not isinstance(b,(int,float)) and not isinstance(c,(int,float)) and a!=0:
raise TypeError('bad operand type')
if b**2 - 4*a*c < 0:
return
else:
x = (-b + math.sqrt(b**2 - 4*a*c))/(2*a)
y = (-b - math.sqrt(b**2 - 4*a*c))/(2*a)
return x,y