Discussion :: Python MCQs
-
What is the output of the code shown below?A = [[1, 2, 3],[4, 5, 6],[7, 8, 9]][A[i][len(A)-1-i] for i in range(len(A))]
Answer : Option C
Explanation :
This expression scales the common index to fetch A[0][2], A[1][1], etc. We assume the matrix has the same number of rows and columns.
Be The First To Comment