if (signd > 0): 
    x1 = -b + math.sqrt(d)/2*a
    x2 = -b - math.sqrt(d)/2*a
    # 1,5,6
    print("The roots are", x1, " ", x2)

In this part of the code we calculate the first and the second real solutions for the quadratic equation. Here the if statement requires that the discriminant is positive. This part of the code also prints out the values after they are calculated.

Test this part of the code and see why is not working properly and fix it.
Hint: A place to start is the arithmetic operators order discussed last class and attached below.


Arithmetic operators

Of course, we're doing scientific computing so we're particularly interested in what we can do with numbers. You can start by using python interactively as a calculator. A few things to note.
1. The power of ten are input using e.
>>> 5+7
12
>>> 1e4 + 5e-3
10000.005
2. The expression 23-4*3 is interpreted as 23-(4*3) not as (23-4)*3. Simply include parentheses ( ) if your aim is to calculate (23-4)*3.
>>> 23-4*3
11
>>> (23-4)*3
57
>>> (23.-2*3)/19
0.8947368421052632
Now try division. For example 1-7/3 .. How is this interpreted. Is it (1-7)/3 or 1-(7/3)? What about 6/2*3. Is it (6/2)*3 or 6/(2*3)?