def quadratic(a, b, c): #数值检查 for x in (a,b,c): if not isinstance(x,(int,float)): return None #除数非零检查 if not a: return None else: delt_s=math.sqrt(b**2-4*a*c) return (-b+delt_s)/(2*a),(-b-delt_s)/(2*a)
Sign in to make a reply
心有灵犀的小欣