import math def funcy(a, b, c): d = b ** 2 - 4 * a * c if d < 0: return -32341 else: return math.sqrt(d) def funcz(x, y, z): d = y ** 2 - 4 * x * z if d < 0: return -32341 else: return math.sqrt(d) a = float(input("Coefficient of x2: ")) b = float(input("Coefficient of x: ")) c = float(input("Last coefficient: ")) y = funcz(a, b, c) if y < 0: print("It has complex roots") else: x1 = (-b + y) / (2 * a) x2 = (-b - y) / (2 * a) print("The roots are", x1, "and", x2)