Question Detail

BIO 107 While Loops & Control Flow Objective Question

Question

According to the document, when is the break statement most appropriate to use?
Options
A When the loop should end based on a fixed number of iterations.
B When the exit condition depends on something unpredictable, like user input.
Correct Answer
C When you want to continue to the next iteration of the loop.
D When the loop's condition is always False from the start.
Correct Answer

Option B is the correct answer.

Detailed Explanation

Slide 10, 'When to use Break?', states: 'Use when the exit condition depends on something unpredictable, like user input or a complex check inside.'

Hint

Distinguish between 'Normal Condition' and 'Break Statement' use cases.

Question Info