Question Detail

COS 102 6 lecture note; fundamentals of programming Objective Question

Question

What is the primary effect of the break statement when executed inside a loop in Python?
Options
A It skips the current iteration and moves to the next one.
B It immediately terminates the execution of the loop it is in.
Correct Answer
C It marks a point for debugging but has no execution effect.
D It restarts the loop from the beginning.
Correct Answer

Option B is the correct answer.

Detailed Explanation

Page 94 explains: 'Break can be used to unconditionally jump out of the loop. It terminates the execution of the loop.'

Hint

Think about the common meaning of 'break' in a continuous process.

Question Info