human
Modify a matrix by rotating ith row exactly i times in clockwise direction | Function to rotate every i - th row of the matrix i times.
Traverse the matrix row - wise.
Reverse the current row.
Reverse the first i elements.
Reverse the last ( N - i ) elements.
Increment count.
Print final matrix.
Driver Code"
How can the above be solved in Python?

=====
Can you provide a code to modify a matrix by rotating ith row exactly i times in clockwise direction and the other steps required?
assistant
#Here is code to modify a matrix by rotating ith row exactly i times in clockwise direction and the other steps required.
 def rotateMatrix ( mat ) :
	i = 0
	mat1 = [ ]
	for it in mat :
		it . reverse ( )
		it1 = it [ : i ]
		it1 . reverse ( )
		it2 = it [ i : ]
		it2 . reverse ( )
		i += 1
		mat1 . append ( it1 + it2 )
	for rows in mat1 :
		for cols in rows :
			print ( cols , end = " ▁ " )
		print ( )
if __name__ == " _ _ main _ _ " :
	mat = [ [ 1 , 2 , 3 ] , [ 4 , 5 , 6 ] , [ 7 , 8 , 9 ] ]
	rotateMatrix ( mat )