各位巨佬,请问这错在哪里?
import math
def quadratic_equation(a, b, c):
answer = b * b - 4 * a * c
x1 = (-b + math.sqrt(answer)) / 2 * a
x2 = (-b - math.sqrt(answer)) / 2 * a
return x1, x2
print quadratic_equation(2, 3, 0)
print quadratic_equation(1, -6, 5)
import math
def quadratic_equation(a, b, c):
answer = b * b - 4 * a * c
x1 = (-b + math.sqrt(answer)) / 2 * a
x2 = (-b - math.sqrt(answer)) / 2 * a
return x1, x2
print quadratic_equation(2, 3, 0)
print quadratic_equation(1, -6, 5)
2018-12-17
举报