logo

Question detail

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

Try the question, check the answer, then read the explanation to understand the curriculum point.

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

Model answer

What a good answer should say

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

Explanation

Why this works

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

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.