Answer
The code is below.
Work Step by Step
import math
a=float(input("Enter a:"))
b=float(input("Enter b:"))
c=float(input("Enter c:"))
discriminant=(math.pow(b,2)-(4*a*c),0.5)
if(discriminant>0):
$ $ $ $ $ $ $ $ $ $ ans1=((b*(-1))+math.pow((math.pow(b,2)-4*a*c),0.5))/(2*a)
$ $ $ $ $ $ $ $ $ $ ans2 = ((b * (-1)) - math.pow((math.pow(b, 2) - 4 * a * c), 0.5)) / (2 * a)
$ $ $ $ $ $ $ $ $ $ print("The roots are {} and {} ".format(ans1,ans2))
elif(discriminant==0):
$ $ $ $ $ $ $ $ ans=((b*(-1))+math.pow((math.pow(b,2)-4*a*c),0.5))/(2*a)
$ $ $ $ $ $ $ $ print("the equation has one root ",ans)
else:
$ $ $ $ $ $ $ $ print('the equation has no real roots')