Question Detail

BIO 107 While Loops & Control Flow Objective Question

Question

According to the document, an 'Infinite Loop' primarily occurs when:
Options
A The <code>while</code> keyword is misspelled.
B The loop's condition never becomes <code>False</code>.
Correct Answer
C The program runs out of memory.
D The <code>print()</code> function is used too many times.
Correct Answer

Option B is the correct answer.

Detailed Explanation

Page 7 defines an 'Infinite Loop' as occurring 'when the condition never becomes False.' This usually happens if the control variable is not updated correctly.

Hint

The definition is directly given in the 'The Infinite Loop' section.

Question Info