diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index 677d7ca02c3f2f..0b8f971185f224 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -166,15 +166,13 @@ arguments. In chapter :ref:`tut-structures`, we will discuss in more detail abo The :keyword:`break` statement breaks out of the innermost enclosing :keyword:`for` or :keyword:`while` loop. -A :keyword:`!for` or :keyword:`!while` loop can include an :keyword:`!else` clause. +The :keyword:`!break` statement may be paired with an :keyword:`!else` clause. +If the loop exits without executing the break, the else clause executes. In a :keyword:`for` loop, the :keyword:`!else` clause is executed -after the loop reaches its final iteration. +after the loop reaches its final iteration if no break occurred. -In a :keyword:`while` loop, it's executed after the loop's condition becomes false. - -In either kind of loop, the :keyword:`!else` clause is **not** executed -if the loop was terminated by a :keyword:`break`. +In a :keyword:`while` loop, it's executed after the loop's condition becomes false if no break occurred. This is exemplified in the following :keyword:`!for` loop, which searches for prime numbers::