logo

AQA A-Level Computer Science practice

In Python, which expression accesses the value in row 2 and column 3 of a two-dimensional array called matrix, using zero-based indexing?

Try the question first, then check the answer and practise the same topic again.

At a glance

MCQ

Type

practice

Style

Topic

Data structures and abstract data types

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?.

  1. A.matrix[2][3]
  2. B.matrix[3][2]
  3. C.matrix[2, 3, 0]
  4. 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.

Related flashcards

No flashcards are published for this page yet.

Related practice questions