logo

AQA A-Level Computer Science practice

What is printed by this Python code?

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

At a glance

MCQ

Type

practice

Style

Topic

Searching algorithms

Exam-style question

Try this first

What is printed by this Python code?.

  1. A.0
  2. B.1
  3. C.2
  4. D.3

Answer and explanation

Concise answer

0

Why this is correct

The values are at indices 0 through 3. The target value 4 is the final item, so the search prints index 3 and stops.

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