Challenge: Given numbers a, b, and c, the quadratic equation ax2+bx+c=0 can have zero, one or two real solutions (i.e; values for x that satisfy the equation). The quadratic formula
x=−b±b2−4ac√2a
can be used to compute these solutions. The expression b2−4ac is the discriminant associated with the equation. If the discriminant is positive, the equation has two solutions. If the discriminant is zero, the equation has one solution. Finally, if the discriminant is negative, the equation has no solutions.
Write a Python function smaller_root that takes an input the numbers a , b and c and returns the smaller solution to this equation if one exists. If the equation has no real solution, print the message "Error: No real solutions" and simply return. Note that, in this case, the function will actually return the special Python value None .