为什么不对呀
import math
def quadratic_equation(a, b, c):
x1=0
x2=0
if b*b-4*a*c>0:
x1=(-b+math.sqrt(b*b-4*a*c))/2*a
x2=(-b-math.sqrt(b*b-4*a*c))/2*a
return x1 ,x2
print quadratic_equation(2, 3, 0)
print quadratic_equation(1, -6, 5)
这个有什么问题吗
import math
def quadratic_equation(a, b, c):
x1=0
x2=0
if b*b-4*a*c>0:
x1=(-b+math.sqrt(b*b-4*a*c))/2*a
x2=(-b-math.sqrt(b*b-4*a*c))/2*a
return x1 ,x2
print quadratic_equation(2, 3, 0)
print quadratic_equation(1, -6, 5)
这个有什么问题吗
2020-03-02
举报