import math def quadratic_equation(a,b,c): D=b*b-4*a*c if D<0: return elif D==0: return -b/(2*a) else: x1=(-b + math.sqrt(D))/(2*a) x2=(-b - math.sqrt(D))/(2*a) return x1,x2 print quadratic_equation(2,3,0) print quadratic_equation(1,-6,5)
报错:SyntaxError: invalid syntax
Python 版本 3.6
IT自学
Mute_
慕的地6079101
0puppy0
相关分类