a,b,c = input("Please input a,b,c")
from math import sqrt
d = b*b-4*a*c
if(a == 0):
x1 = x2 = -c/b
print "該方程不是一元二次方程,x=”,x1
elif (d>0):
x1 = (-b+sqrt(d))/(2*a)
x2 = (-b-sqrt(d))/(2*a)
print "方程有兩個異根","x1=",x1,"x2=",x2
elif(d = 0):
x1 = x2 =-b/2a
print "方程有兩個同根","x1=x2",x1
else:
print "方程無實數解"
eol while scanning string literal 編譯器報錯 小白一個 總覺得沒寫錯 求大神指點一下謝謝謝謝
print,第一個print函數中,後面那個引號不是英文的引號,是中文引號。