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 ?

From Piet van Oostrum <piet@vanoostrum.org>
Newsgroups comp.lang.python
Subject Re: What’s the differences between these two pieces of code ?
Date 2012-09-09 20:29 +0200
Message-ID <m2a9wz3v8a.fsf@cochabamba.vanoostrum.org> (permalink)
References <48fbfc85-c495-4131-a18a-1ebb94e7ce20@googlegroups.com>

Show all headers | 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