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
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.
