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


Groups > comp.lang.python > #28792 > unrolled thread

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

Started byPiet van Oostrum <piet@vanoostrum.org>
First post2012-09-09 20:29 +0200
Last post2012-09-09 20:29 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

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

FromPiet van Oostrum <piet@vanoostrum.org>
Date2012-09-09 20:29 +0200
SubjectRe: What’s the differences between these two pieces of code ?
Message-ID<m2a9wz3v8a.fsf@cochabamba.vanoostrum.org>
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]

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web