哪儿错了呢大哥们
import math
def quadratic_equation(a, b, c):
if (b*b-4*a*c) >= 0:
x1=(math.sprt(b*b-4*a*c)-b)/(2*a)
x2=(-(math.sprt(b*b-4*a*c)-b)/(2*a)
return x1,x2
else:
return None
print quadratic_equation(2, 3, 0)
print quadratic_equation(1, -6, 5)
import math
def quadratic_equation(a, b, c):
if (b*b-4*a*c) >= 0:
x1=(math.sprt(b*b-4*a*c)-b)/(2*a)
x2=(-(math.sprt(b*b-4*a*c)-b)/(2*a)
return x1,x2
else:
return None
print quadratic_equation(2, 3, 0)
print quadratic_equation(1, -6, 5)
2018-03-26
举报