Question: NOTE: Solve this code using python: YOU CANNOT USE ANY BUILT - IN FUNCTION EXCEPT len IN PYTHON. [ negative indexing, append is prohibited ]

NOTE: Solve this code using python:
YOU CANNOT USE ANY BUILT-IN FUNCTION EXCEPT len IN
PYTHON. [negative indexing, append is prohibited]
You can use the attribute shape of numpy arrays
YOU HAVE TO MENTION SIZE OF ARRAY WHILE INITIALIZATION
YOUR CODE SHOULD WORK FOR ANY VALID INPUTS. [Make
changes to the Sample Inputs and check whether your program works
correctly] Here is the code : def check_diagonal(matrix1, matrix2):
#TO DO
array1= np.array([[0,4,1],[7,2,5],[3,6,0]])
array2= np.array([[3,6,0],[5,2,7],[0,4,1]])
check_Diagonal(array1, array2) #This should print YES
print(".............")
array1= np.array([[0,9,9,1],[9,0,2,9],[9,3,0,9],[4,9,9,0]])
array2= np.array([[4,9,9,0],[9,0,3,9],[9,0,2,9],[0,9,5,1]])
check_Diagonal (array1, array2) #This should print NO

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!