logo

AQA A-Level Computer Science practice

In Python 3, what value is stored in result after this code runs? def double(number): return number * 2 result = double(6)

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

At a glance

MCQ

Type

practice

Style

Topic

Programming

Exam-style question

Try this first

In Python 3, what value is stored in result after this code runs? def double(number): return number * 2 result = double(6).

  1. A.6
  2. B.8
  3. C.12
  4. D.None

Answer and explanation

Concise answer

12

Why this is correct

The subroutine receives 6, calculates 6 multiplied by 2, and returns 12 to the calling routine. The returned value is then assigned to result.

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