Discuss / Python / 作业

作业

Topic source

爱调小铺

#1 Created at ... [Delete] [Delete and Lock User]
delta=b*b-4*a*c
    if delta>0:
        x1=(-b+math.sqrt(delta))/(2*a)
        x2=(-b-math.sqrt(delta))/(2*a)
        return x1,x2
    elif delta==0:
        x1=x2=-b/(2*a)
        return x1,x2
    else:
        return '无解'

  • 1

Reply