Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bdbdfb1

Browse files
committed
Confirm that the prime example is actually correct. We get so many complaints about a "buggy example" on docs@python, let us hope this cuts them in half at least.
1 parent db79e95 commit bdbdfb1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Doc/tutorial/controlflow.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ following loop, which searches for prime numbers::
184184
8 equals 2 * 4
185185
9 equals 3 * 3
186186

187+
(Yes, this is the correct code. Look closely: the ``else`` clause belongs to
188+
the :keyword:`for` loop, **not** the :keyword:`if` statement.)
189+
187190

188191
.. _tut-pass:
189192

0 commit comments

Comments
 (0)