Discuss / Python / 定义函数

定义函数

Topic source

七月上行

#1 Created at ... [Delete] [Delete and Lock User]
deta = pow(b,2) - 4*a*c
if deta < 0:
    print ('no answer')
    return
elif deta == 0:
    return - b / (2*a)
else :
    return -(b-math.sqrt(deta)) / (2*a), -(b+math.sqrt(deta)) / (2*a)

  • 1

Reply