Hi, 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. Regards, Eric Takada This message is intended solely for the use of its addressee and may contain privileged or confidential information. All information contained herein shall be treated as confidential and shall not be disclosed to any third party without Embraer?s prior written approval. If you are not the addressee you should not distribute, copy or file this message. In this case, please notify the sender and destroy its contents immediately. Esta mensagem é para uso exclusivo de seu destinatário e pode conter informações privilegiadas e confidenciais. Todas as informações aqui contidas devem ser tratadas como confidenciais e não devem ser divulgadas a terceiros sem o prévio consentimento por escrito da Embraer. Se você não é o destinatário não deve distribuir, copiar ou arquivar a mensagem. Neste caso, por favor, notifique o remetente da mesma e destrua imediatamente a mensagem.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 28.09.2010 17:53, schrieb eric.takada@embraer.com.br:
Hi,
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.
Regards,
Eric Takada
Hi Eric, 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.) regards, Georg -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) iEYEARECAAYFAky63HoACgkQN9GcIYhpnLDG5QCeIGLEeWz0Zbt0l4hSAnGYEF1r MvEAoIm5wG5GLw0qcHqDnr6jl3ZB3XFc =o1f/ -----END PGP SIGNATURE-----
participants (2)
-
eric.takada@embraer.com.br -
Georg Brandl