human
Find if given matrix is Toeplitz or not | Python3 program to check whether given matrix is a Toeplitz matrix or not.
row = number of rows col = number of columns.
dictionary to store key , value pairs.
if key value exists in the map ,.
we check whether the current value stored in this key matches to element at current index or not . If not , return false.
else we put key , value pair in map.
Driver Code.
Function call"
How can the above be solved in Python?

=====
Give me a code to find if given matrix is Toeplitz or not and the other steps required?
assistant
#Here is code to find if given matrix is Toeplitz or not and the other steps required.
 def isToeplitz ( matrix ) :
	row = len ( matrix )
	col = len ( matrix [ 0 ] )
	map = { }
	for i in range ( row ) :
		for j in range ( col ) :
			key = i - j
			if ( key in map ) :
				if ( map [ key ] != matrix [ i ] [ j ] ) :
					return False
			else :
				map [ key ] = matrix [ i ] [ j ]
	return True
if __name__ == " _ _ main _ _ " :
	matrix = [ [ 12 , 23 , - 32 ] , [ - 20 , 12 , 23 ] , [ 56 , - 20 , 12 ] , [ 38 , 56 , - 20 ] ]
	if ( isToeplitz ( matrix ) ) :
		print ( " Yes " )
	else :
		print ( " No " )