Exam-style question
Try this first
What happens when a Python 3 subroutine executes a return statement?.
- A.It repeats the subroutine from the beginning
- B.It sends a value back to the calling routine and ends that subroutine's execution
- C.It displays the value automatically on the screen
- 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.
