From: Georg Brandl Date: Mon, 8 Aug 2011 19:45:13 +0000 (+0200) Subject: Confirm that the prime example is actually correct. We get so many complaints about... X-Git-Tag: v2.7.3rc1~527 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a350f0f9fd40708ca863b01aa09402f362d5ea44;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index 5c7ca4e0a4ec..43a83823b6cd 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -156,6 +156,9 @@ following loop, which searches for prime numbers:: 8 equals 2 * 4 9 equals 3 * 3 +(Yes, this is the correct code. Look closely: the ``else`` clause belongs to +the :keyword:`for` loop, **not** the :keyword:`if` statement.) + .. _tut-pass: