Discuss / Python / 正确答案在这里

正确答案在这里

Topic source

    x1=(-b+math.sqrt(b**2-4*a*c))/(2*a)

    x2=(-b-math.sqrt(b**2-4*a*c))/(2*a)

    return x1,x2

#顺带一提,如果你把±号的顺序互换了,即x1用-号,x2用+号,虽然得出了正确的根,但是会返回‘测试失败’的。


  • 1

Reply