logo

AQA A-Level Computer Science practice

What happens when a Python 3 subroutine executes a return statement?

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

What happens when a Python 3 subroutine executes a return statement?.

  1. A.It repeats the subroutine from the beginning
  2. B.It sends a value back to the calling routine and ends that subroutine's execution
  3. C.It displays the value automatically on the screen
  4. D.It permanently stores the value in the subroutine

Answer and explanation

Concise answer

It sends a value back to the calling routine and ends that subroutine's execution

Why this is correct

The return statement transfers a value to the code that called the subroutine. Execution of that subroutine stops at the return statement.

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