Question Detail

BIO 107 While Loops & Control Flow Objective Question

Question

What is the primary purpose of the break statement in a loop, as described in the document?
Options
A To restart the loop from the beginning.
B To skip the current iteration and move to the next.
C To exit a loop instantly, even if the condition is still <code>True</code>.
Correct Answer
D To pause the loop for a specified duration.
Correct Answer

Option C is the correct answer.

Detailed Explanation

Page 9 states, 'Sometimes you need to exit a loop instantly, even if the condition is still True.' This is precisely what the break statement achieves.

Hint

The title of the slide 'The "break" Statement' on page 9 explains its core function.

Question Info