Discuss / Python / 作业

作业

Topic source

IE之梦

#1 Created at ... [Delete] [Delete and Lock User]

不会一元二次方程,,还特意百度了一下看看是咋回事 纠结

import math
def q(a,b,c):
    x=b*b-4*a*c
    x1=(-b+math.sqrt(x))/(2*a)
    x2=(-b-math.sqrt(x))/(2*a)
    return x1,x2
print(q(2,3,1))
print(q(1,3,-4))

  • 1

Reply