0
Is there something wrong?
Im new to python and i wanted to make a program calculating the Discriminant of an quadratic equation. But At d=0: there is an error syntax someone help please^^ # File: Discriminant.py # This program calculates the discriminant of a quadratic equation. With a<0 or a>0 def discriminant(): print("The quadratic equation is ax^2+bx+c=0") a =eval(input("The a value:")) b =eval(input("The b value:")) c =eval(input("The c value:")) import cmath a=1 b=-2 c=1 d = (b**2)-4*(a*c) if d>0: sol1= (-b+cmath.sqrt(d))/(2*a) sol2= (-b-cmath.spqrt(d))/(2*a) else if d=0: sol=-b/2*a else if d<0: print("error")
5 Respostas
+ 2
else if ==> elif
if d=0 ==> if d==0
+ 1
Anna Thank you so much!
0
Anna Well there isn't any output for it 0.0 shouldn't it be?
0
There is no print statement for the case that d==0. It will only print "error" if d<0
0
Anna generally aftet i made the input order it didn't generate anything as an output for the whole code