Discuss / Python / 打卡

打卡

Topic source

13个望辰

#1 Created at ... [Delete] [Delete and Lock User]
def quadratic(a,b,c):
  import math
  m=pow(b,2)-4*a*c
  if m>=0:
    x1=(-b+math.sqrt(m))/(2*a)
    x2=(-b-math.sqrt(m))/(2*a)
    x=[x1,x2]
    return x
  else:
    print('无解!')

  • 1

Reply