import math
a = 2
b = 4
c = 2
discriminant = b**2 - 4*a*c
if discriminant 0:
print("The roots are complex.")
else:
root1 = (-b + math.sqrt(discriminant)) / (2*a)
root2 = (-b - math.sqrt(discriminant)) / (2*a)
print("The roots are:", root1, "and", root2)

What is the output of the following python program

Posted on by