def numRoots(a, b, c): disc = b ** 2 - 4 * a * c # If the discriminant is greater than zero, there are two real roots. if disc > 0: return 2 # Else if the discriminant is equal to zero, there is one real root. elif disc == 0: return 1 # Otherwise the discriminant is negative, so there is no real root. else: return 0 print("Consider an equation of the form ax^2 + bx + c = 0...") a = float(input("Enter the value of a: ")) b = float(input("Enter the value of b: ")) c = float(input("Enter the value of c: ")) n = numRoots(a, b, c) print(f"That equation has {n} real roots.")