Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #28792

Re: What’s the differences between these two pieces of code ?

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 <piet@vanoostrum.org>
Newsgroups comp.lang.python
Subject Re: What’s the differences between these two pieces of code ?
Date Sun, 09 Sep 2012 20:29:57 +0200
Lines 21
Message-ID <m2a9wz3v8a.fsf@cochabamba.vanoostrum.org> (permalink)
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

Show key headers only | View raw


iMath <redstone-cold@163.com> 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 <piet@vanoostrum.org>
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: What’s the differences between these two  pieces of code ? Piet van Oostrum <piet@vanoostrum.org> - 2012-09-09 20:29 +0200

csiph-web