Question Detail

BIO 107 While Loops & Control Flow Objective Question

Question

In the "Guess the Number Game," why is while True: used as the loop condition?
Options
A It ensures the loop runs exactly seven times.
B It automatically generates a random secret number.
C It allows the loop to continue indefinitely until explicitly exited (e.g., by a <code>break</code> statement).
Correct Answer
D It checks if the user's guess is always correct.
Correct Answer

Option C is the correct answer.

Detailed Explanation

Page 12 states "Use while True: to keep asking for a guess." This means the loop will run forever unless a break statement is encountered.

Hint

What does True evaluate to in a boolean context?

Question Info