[docs] Algorithm error
georg at python.org
Sun Oct 17 13:22:34 CEST 2010
-----BEGIN PGP SIGNED MESSAGE-----
Am 28.09.2010 17:53, schrieb eric.takada at embraer.com.br:
> in section */"4.4 break and continue Statements, and else Clauses on Loops"
> /*there is an error in the example code. The "range" in "for x in range(2, n): "
> shall be changed to "range(1,n):" in order to produce the output described in
> the example, since "range[2,2]" produces a null result.
> Eric Takada
please retry running the example; it is correct as written. Note that the
"else" clause belongs to the for loop, and not the if condition, and therefore
has different semantics (for example, it is executed in the case that the loop
does not run at all.)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the docs