Function for applying Newton 's  divided difference formula
def applyFormula ( value , x , y , n ) : NEW_LINE INDENT sum = y [ 0 ] [ 0 ] ; NEW_LINE for i in range ( 1 , n ) : NEW_LINE INDENT sum = sum + ( proterm ( i , value , x ) * y [ 0 ] [ i ] ) ; NEW_LINE DEDENT return sum ; NEW_LINE DEDENT