Discuss / Python / 打卡-作业-测试通过

打卡-作业-测试通过

Topic source

南丁叔叔

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

import math

def quadratic(a, b, c):

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

 if delta>=0:

  x1 = (math.sqrt(delta)-b)/(2*a)

  x2 = (-b-math.sqrt(delta))/(2*a)

 else:

  print('此方程无解')

 return tuple({x1,x2})


  • 1

Reply