Discuss / Python / 交作业

交作业

Topic source
    if a == 0:
        x=-c/b
        return x
    else:
        deta=b*b-4*a*c
        if deta >= 0:
            x1=(-b+math.sqrt(deta))/(2*a)
            x2=(-b-math.sqrt(deta))/(2*a)
            return x1,x2
        else:
            return '无实数解'

  • 1

Reply