QuestenaПрактика, после которой понятно, что повторить
Вопрос 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 itПравильный ответ
  4. Only after the body; an empty body stops it

Объяснение

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.

Продолжить работу с тестом

Начать тренировку
Вопрос 63: When no break, return, or exception occurs, when does a… · Python Fundamentals · Questena