Professional Documents
Culture Documents
ALGORITHM:
PYTHON CODE:
QUESTION 27:
ALGORITHM:
PYTHON CODE:
QUESTION 28:
ALGORITHM:
3. Calculate the number of rows and columns present in the matrix and store it variables rows and cols
respectively.
4. Check if the principal diagonal element satisfies the condition that row=column.
5. Print the matrix first and then print the diagonal elements.
PYTHON CODE: