Discuss / Python / 作业

作业

Topic source

牧殇3399

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

    d=b**2-4*a*c

    if a!=0:

       if d<0:

          print('无实根')

       elif d==0:

          x1=x2=(-b)/(x*a)

          return x1

       else:

          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

牧殇3399

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

修改x1=x2=(-b)/(2*a)


  • 1

Reply