import math
def quadratic(a, b, c):
s = b*b -
4*a*c
if a ==
0:
x = -c / b
return x
elif s==
0:
x = -b /
2*a
return x
elif s <
0:
return 'no anwser'
else:
x = (-b + math.sqrt(s)) / (
2 * a)
y = (-b - math.sqrt(s)) / (
2 * a)
return x, y
转载于:https://www.cnblogs.com/fanren224/p/8457304.html