Boundary elements of a Matrix | Python program to print boundary element of the matrix . ; Driver code
MAX = 100 NEW_LINE def printBoundary ( a , m , n ) : NEW_LINE INDENT for i in range ( m ) : NEW_LINE INDENT for j in range ( n ) : NEW_LINE INDENT if ( i == 0 ) : NEW_LINE INDENT print a [ i ] [ j ] , NEW_LINE DEDENT elif ( i == m - 1 ) : NEW_LINE INDENT print a [ i ] [ j ] , NEW_LINE DEDENT elif ( j == 0 ) : NEW_LINE INDENT print a [ i ] [ j ] , NEW_LINE DEDENT elif ( j == n - 1 ) : NEW_LINE INDENT print a [ i ] [ j ] , NEW_LINE DEDENT else : NEW_LINE INDENT print " ▁ " , NEW_LINE DEDENT DEDENT print NEW_LINE DEDENT DEDENT a = [ [ 1 , 2 , 3 , 4 ] , [ 5 , 6 , 7 , 8 ] , [ 1 , 2 , 3 , 4 ] , [ 5 , 6 , 7 , 8 ] ] NEW_LINE printBoundary ( a , 4 , 4 ) NEW_LINE