< hi all,

I am trying to program a quadratic equation solver so that it continues infinitely while the det>=0, and stops when det<0. this is the code, can someone please help me with that?

at the moment, it asks to input a b and c after each input however only gives me the calculation for the first input no matter what a b and c in consequitive inputs are. It has to ask to input a b and c after each calculation except for when det<0 .

Thanks

```
import sys
import math
line = raw_input("input a b c: ")
textnums = line.split();
if(len(textnums) != 3) :
print "Not 3 items on input line"
sys.exit()
try:
a = float(textnums[0])
except ValueError:
print "First item is not a number"
sys.exit()
try:
b = float(textnums[1])
except ValueError:
print "Second item is not a number"
sys.exit()
try:
c = float(textnums[2])
except ValueError:
print "Third item is not a number"
sys.exit()
det = (b*b) - (4*a*c);
det = 0.0
while (det >= 0.0):
line = raw_input("input a b c: ")
textnums = line.split();
if(det > 0.0):
r1 = (-b + math.sqrt(det)) / (2.0 * a),
r2 = (-b - math.sqrt(det)) / (2.0 * a)
print "the coefficients",a,b,c,"have 2 real roots",r1,r2
elif(det == 0.0):
print "the coefficients",a,b,c," have 1 real root ",-b/(2.0 * a)
else:
print "the coefficients",a,b,c," have no real roots"
sys.exit()
```