import math def quadratic_equation(a, b, c): z=b*b-4*a*c if z<0: return None else: x1=(-b+math.sqrt(z))/(2*a) x2=(-b-math.sqrt(z))/(2*a) return x1,x2 print quadratic_equation(2, 3, 0) print quadratic_equation(1, -6, 5)
这样。不知道哪里错了
Davidham3
清波
慕大叔
乔帮主
相关分类