import math def quadratic(a, b, c): for x in (a,b,c): if not isinstance(x,(int,float)): raise TypeError("类型错误!") if a==0: return 0-c/b d=math.sqrt(b*b*1.0-4*a*c) return (0-b+d)/(a*2),(0-b-d)/(a*2)
Sign in to make a reply
叫我玮仔