请问想要判别式分两类,这个代码该怎么改?可以运行但是结果错误
import math def quadratic_equation(a, b, c): delta = math.pow(b,2) - 4*a*c if delta >= 0: x1=(-b+ math.sqrt(delta))/(2*a) x2=(-b- math.sqrt(delta))/(2*a) return x1,x2 else: return None
import math def quadratic_equation(a, b, c): delta = math.pow(b,2) - 4*a*c if delta >= 0: x1=(-b+ math.sqrt(delta))/(2*a) x2=(-b- math.sqrt(delta))/(2*a) return x1,x2 else: return None
2018-06-05
举报