Python - Quadratic Equation PLS respond
<p>We have to make a program that solves a quadratic equation, I did that part but we also have to include a section where the user inputs what they think the correct answer is and if they are right the program should output something like "You are correct". If they are wrong however, it should output something like "You are wrong" and then underneath it should output the correct answers. This is what i have so far can someone please incorporate this part for me My code is below. </p>

<pre><code>print "This program can be used to solve quadratic equations"

print "Below, please input values for a, b, and c" 

print "\n----------------------------\n"

import math


for i in range(39479):

    a = float(raw_input("Enter a value for a: "))
    b = float(raw_input("Enter a value for b: "))
    c = float(raw_input("Enter a value for c: "))

    if a==0:
        print "Please input a value greater than or less than 0 for a"
    else:
        break

print "\n----------------------------\n"


discriminant = (b**2)-(4*(a*c)) 

if discriminant &lt; 0:

    print ("This equation has no real solution")

elif discriminant == 0:

    repeated_solution = (-b-math.sqrt(b**2-4*a*c))/2*a
    print ("This equation has one, repeated solution: "), repeated_solution

else:

    root_1 = (-b+math.sqrt(discriminant))/(2*a)
    root_2 = (-b-math.sqrt(discriminant))/(2*a)
    print "This equation has two solutions:", root_1, " and/or", root_2
</code></pre>

<pre><code>print "This program can be used to solve quadratic equations"

print "Below, please input values for a, b, and c" 

print "\n----------------------------\n"

import math


for i in range(39479):

    a = float(raw_input("Enter a value for a: "))
    b = float(raw_input("Enter a value for b: "))
    c = float(raw_input("Enter a value for c: "))

    if a==0:
        print "Please input a value greater than or less than 0 for a"
    else:
        break

print "\n----------------------------\n"


discriminant = (b**2)-(4*(a*c)) 

if discriminant &lt; 0:

    print ("This equation has no real solution")

elif discriminant == 0:

    repeated_solution = format((-b-math.sqrt(b**2-4*a*c))/2*a,'.3f')
    guess=format(float(raw_input("This equation has one, repeated solution, Make a guess:")),'.3f')
    if guess==repeated_solution:
        print "You are correct.WOW!"
        print ("This equation has one, repeated solution: "), repeated_solution        
    else:
        print "Wrong Answer"
else:
    root_1 = format((-b+math.sqrt(discriminant))/(2*a),'.3f')
    root_2 = format((-b-math.sqrt(discriminant))/(2*a),'.3f')
    guess1=format(float(raw_input("This equation has two solutions, Make a guess for solution1:")),'.3f')
    guess2=format(float(raw_input("This equation has two solutions, Make a guess for solution2:")),'.3f')
    if set([root_1,root_2]).issubset( [guess1,guess2]):
        print "You are correct.WOW!"
        print "This equation has two solutions:", root_1, " and/or", root_2
    else:
        print "Wrong Answer"
</code></pre>

python python-2.7 python-3.x