Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Piet van Oostrum Newsgroups: comp.lang.python Subject: Re: =?utf-8?Q?What=E2=80=99s?= the differences between these two pieces of code ? Date: Sun, 09 Sep 2012 20:29:57 +0200 Lines: 21 Message-ID: References: <48fbfc85-c495-4131-a18a-1ebb94e7ce20@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net wBDH1sxJBj/20HSSiR9kwAxK4KdLkp9zALjKQI6GKXGQWTdbjwFzr9EXGeARofryG7 Cancel-Lock: sha1:3N58qHgB4otNFnbunIL+NjPLoEo= sha1:/0c9GGgq+FqkwVduxF+1HUan8fw= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3.50 (darwin) Xref: csiph.com comp.lang.python:28792 iMath writes: > What’s the differences between these two pieces of code ? > (1) > for i in range(1, 7): > print(2 * i, end=' ') > > > (2) > for i in range(1, 7): > print(2 * i, end=' ') > print() > > > when executed both respectively in Python shell ,I get the same effect . Who can tell me why ? The first one gives a syntax error (IndentationError: expected an indented block) -- Piet van Oostrum WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4]