Average of even numbers till a given even number | Function to calculate the average of even numbers ; Driver function
def averageEven ( n ) : NEW_LINE INDENT if ( n % 2 != 0 ) : NEW_LINE INDENT print ( " Invalid ▁ Input " ) NEW_LINE return - 1 NEW_LINE DEDENT return ( n + 2 ) // 2 NEW_LINE DEDENT n = 16 NEW_LINE print ( averageEven ( n ) ) NEW_LINE