Question

Complete the Python code to print the elements of the main diagonal of a square matrix matrix of size N x N. def print_main_diagonal(matrix,

  • N :     for i in range(
  • N :         _________ # Line to complete
A print(matrix[i][N - 1 - i])
B print(matrix[i][0])
C print(matrix[0][i])
D print(matrix[i][i])
E print(matrix[N - 1 - i][i])
Practice Next

Hey! Ask a query