Maximum and Minimum value of a quadratic function | Function to print the Maximum and Minimum values of the quadratic function ; Calculate the value of second part ; Print the values ; Open upward parabola function ; Open downward parabola function ; If a = 0 then it is not a quadratic function ; Driver code
def PrintMaxMinValue ( a , b , c ) : NEW_LINE INDENT secondPart = c * 1.0 - ( b * b / ( 4.0 * a ) ) ; NEW_LINE if ( a > 0 ) : NEW_LINE INDENT print ( " Maxvalue ▁ = " , " Infinity " ) ; NEW_LINE print ( " Minvalue ▁ = ▁ " , secondPart ) ; NEW_LINE DEDENT elif ( a < 0 ) : NEW_LINE INDENT print ( " Maxvalue ▁ = ▁ " , secondPart ) ; NEW_LINE print ( " Minvalue ▁ = " , " - Infinity " ) ; NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Not ▁ a ▁ quadratic ▁ function " ) ; NEW_LINE DEDENT DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT a = - 1 ; b = 3 ; c = - 2 ; NEW_LINE PrintMaxMinValue ( a , b , c ) ; NEW_LINE DEDENT