logo

AQA A-Level Computer Science practice

In the Python subroutine definition below, which value is passed to the parameter named number when the subroutine is called? ```python def showDouble(number): print(number * 2) showDouble(7) ```

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 the Python subroutine definition below, which value is passed to the parameter named number when the subroutine is called? ```python def showDouble(number): print(number * 2) showDouble(7) ```.

  1. A.2
  2. B.7
  3. C.14
  4. D.number

Answer and explanation

Concise answer

7

Why this is correct

The argument 7 is supplied in the call and is passed to the parameter number. The subroutine then calculates 7 multiplied by 2, producing 14.

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