感觉没有错
import math
def quadratic_equation(a, b, c):
d = b * b - 4 * a * c
if a != 0:
if d > 0:
x1= (-b + math.sqrt(d))/(2*a)
x2= (-b - math.sqrt(d))/(2*a)
return x1,x2
else:
return
else return -c/b
print quadratic_equation(2, 3, 0)
print quadratic_equation(1, -6, 5)
没过