为什么不对
import math def quadratic_equation(a, b, c): d=b*b-4*a*c if d>= 0: x1 = (-b+math.sqrt(d))/(2*a) x2 = (-b-math.sqrt(d))/(2*a) return x1,x2 else: return print quadratic_equation(2, 3, 0) print quadratic_equation(1, -6, 5) 为什么提示不正确
import math def quadratic_equation(a, b, c): d=b*b-4*a*c if d>= 0: x1 = (-b+math.sqrt(d))/(2*a) x2 = (-b-math.sqrt(d))/(2*a) return x1,x2 else: return print quadratic_equation(2, 3, 0) print quadratic_equation(1, -6, 5) 为什么提示不正确
2015-12-15
举报