# L-10.5 MCS 260 Wed 9 Jul 2014 : q10.py
"""
Define a Python function that returns as a tuple the roots of a
polynomial p(x) = a*x**2 + b*x + c,
using (-b +/- sqrt(b**2 - 4*a*c))/(2*a).
Write the function so that 1 is the default value for a.
"""
def roots ( cx0, bx1, ax2=1 ):
    "returns roots via quadratic formula"
    from cmath import sqrt
    disc = sqrt(bx1**2 - 4*ax2*cx0)
    return ((-bx1+disc)/(2*ax2), (-bx1-disc)/(2*ax2))

ARAW = raw_input('give a : ')
BRAW = raw_input('give b : ')
CRAW = raw_input('give c : ')
A = float(ARAW)
B = float(BRAW)
C = float(CRAW)
print 'roots = ', roots(C, B, A)
