QuestenaPractice that shows what to review next
Question 63

When no break, return, or exception occurs, when does a while loop test its condition, and what makes repetition stop?

  1. Only once, before the loop; a return value stops it
  2. After every pass; a true condition stops it
  3. Before every pass; a falsy condition stops itCorrect answer
  4. Only after the body; an empty body stops it

Explanation

The condition is checked before every attempted pass, so a false initial condition prevents the body from running at all. A post-body-only test would incorrectly guarantee at least one execution.

Continue with this test

Start practice
Question 63: When no break, return, or exception occurs, when does a… · Python Fundamentals · Questena