UPDATE: jmi...@atomant:~/tmp$ cat polycalc.py #!/usr/bin/env python
from math import sqrt def f(a, b, c): if (b**2 - (4 * a * c)) < 0: return None, None # Can't solve x1 = -b - (sqrt(b**2 - (4 * a * c)) / (2 * a)) x2 = -b + (sqrt(b**2 - (4 * a * c)) / (2 * a)) return x1, x2 print "Polynomial Solver..." print while True: a = float(raw_input("a: ")) b = float(raw_input("b: ")) c = float(raw_input("c: ")) x = f(a, b, c) if None in x: print "Can't solve!" else: print "x = (%0.2f, %0.2f)" % x jmi...@atomant:~/tmp$ ./polycalc.py Polynomial Solver... a: 1 b: 8 c: 5 x = (-11.32, -4.68) -- http://mail.python.org/mailman/listinfo/python-list