QuestenaPráctica que te muestra qué repasar después
Pregunta 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 itRespuesta correcta
  4. Only after the body; an empty body stops it

Explicación

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.

Continúa con este test

Empezar la práctica
Pregunta 63: When no break, return, or exception occurs, when does a… · Python Fundamentals · Questena