Discuss / Python / 打卡

打卡

Topic source
import mathdef quadratic(a, b, c):#    if b * b < 4 * a *c:#        x = math.sqrt(4*a*c - b*b)#    else:    x = math.sqrt(b*b - 4*a*c)    print(x)    x3 = 2*a    print(x3)    x1 = (-b + x) / x3    x2 = (-b - x) / x3    return x1, x2print(quadratic(2,3,1))

  • 1

Reply