已经在开头调用数学模块了啊
import math def quadratic_equation(a, b, c): x1 = ((-b) + sqrt(b*b-4*a*c))/(2*a) x2 = ((-b) - sqrt(b*b-4*a*c))/(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): x1 = ((-b) + sqrt(b*b-4*a*c))/(2*a) x2 = ((-b) - sqrt(b*b-4*a*c))/(2*a) return x1,x2 print quadratic_equation(2, 3, 0) print quadratic_equation(1, -6, 5) 有个问题,这样哪里错了??
2017-04-20
举报