Exam-style question
Try this first
In Python, which expression accesses the value in row 2 and column 3 of a two-dimensional array called matrix, using zero-based indexing?.
- A.matrix[2][3]
- B.matrix[3][2]
- C.matrix[2, 3, 0]
- D.matrix[23]
Answer and explanation
Concise answer
matrix[2][3]
Why this is correct
In a Python representation of a two-dimensional array, the first index selects the row and the second index selects the column. With zero-based indexing, row 2 and column 3 are written as matrix[2][3].
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
