Discuss / Python / 人生苦短,我用Python

人生苦短,我用Python

Topic source

hcie_zpc

#1 Created at ... [Delete] [Delete and Lock User]
    y = b**2 - 4*a*c
    if y < 0:
       raise TypeError('Error Expression!!!')
    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


  • 1

Reply