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