Write a function to return the real of the roots of a quadratic equation else return None ax**2 + bx + c = 0


Topic: Write a function to return the real of the roots of a quadratic equation else return None ax**2 + bx + c = 0

Solution

def roots_of_qad_eq(a:float,b:float,c:float):
    d = b**2-4*a*c
    if d >= 0:
        return (-b+(d)**(1/2))/2*a,(-b-(d)**(1/2))/2*a
    else:
        return None



List all Python Programs