human
Write me a code to centrosymmetric Matrix and the other steps required given the following:
Centrosymmetric Matrix | Python3 Program to check whether given matrix is centrosymmetric or not ..
Finding the middle row of the matrix.
for each row upto middle row ..
If each element and its corresponding element is not equal then return false ..
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to centrosymmetric Matrix and the other steps required.
 def checkCentrosymmetricted ( n , m ) :
	mid_row = 0 ;
	if ( ( n & 1 ) > 0 ) :
		mid_row = n / 2 + 1 ;
	else :
		mid_row = n / 2 ;
	for i in range ( int ( mid_row ) ) :
		for j in range ( n ) :
			if ( m [ i ] [ j ] != m [ n - i - 1 ] [ n - j - 1 ] ) :
				return False ;
	return True ;
n = 3 ;
m = [ [ 1 , 3 , 5 ] , [ 6 , 8 , 6 ] , [ 5 , 3 , 1 ] ] ;
if ( checkCentrosymmetricted ( n , m ) ) :
	print ( " Yes " ) ;
else :
	print ( " No " ) ;