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


Groups > comp.lang.python > #28787

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

Path csiph.com!usenet.pasdenom.info!gegeweb.org!newsfeed.kamp.net!newsfeed.kamp.net!newsfeed.freenet.ag!news2.euro.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <kwpolska@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'received:209.85.223': 0.03; 'executed': 0.07; 'subject:code': 0.07; 'subject:two': 0.07; 'python': 0.09; 'newline,': 0.09; 'sep': 0.09; 'thx': 0.09; 'cc:addr:python-list': 0.10; '3:27': 0.16; 'gpg': 0.16; 'inserting': 0.16; 'subject:between': 0.16; 'subject:these': 0.16; 'wrote:': 0.17; 'pieces': 0.17; 'script.': 0.17; 'shell': 0.18; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'url:mailman': 0.29; 'subject: ?': 0.30; 'code': 0.31; 'url:python': 0.32; '(2)': 0.32; 'running': 0.32; 'url:listinfo': 0.32; 'everyone': 0.33; 'that,': 0.34; 'received:google.com': 0.34; '(1)': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'url:org': 0.36; 'two': 0.37; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'header:Received:5': 0.40; 'url:mail': 0.40; 'between': 0.63; 'show': 0.63; 'differences': 0.65; 'subjectcharset:utf-8': 0.72; 'respectively': 0.84; 'what\xe2\x80\x99s': 0.84; 'to:addr:163.com': 0.91; '8bit%:67': 0.93; 'url:tk': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=GY4EGwt3BO/gmBXX6dLqa336pZfK8ohSJop1WEcknjI=; b=Rk4CgKDJZr8aDItWfcfY37k/rOZSm4BuG/X/+iyQ7xRZOxcQYJViBf5fDsmovd6ebU 0gB+i+AcTzdPDdJQALAcclSnXReuVWFbQ6bPRBNhaIy++FylqYlJIa5sY2zrEPtSmCJV 00HVNi12RexdandJOueWa4FrkGnag2mKCgVSvv7EQXH6CThvC8FueWqwfTSvdfLdcHlE BSk8w55NkCsV2QOKquSPgqLUG3D3PgOm2G/s1Vky2n+isXlGxwq4jFrLJt+CbQ6NqPIn 3wvPCFCbalwLFzUU9HRz3CrdH00eEfY4jFaj6vd0Jj2kEVAauEfqDpqwyJDlDrF/Oa0w i3hg==
MIME-Version 1.0
In-Reply-To <874765ea-d1cd-40cc-ac8c-ff694648cfae@googlegroups.com>
References <48fbfc85-c495-4131-a18a-1ebb94e7ce20@googlegroups.com> <874765ea-d1cd-40cc-ac8c-ff694648cfae@googlegroups.com>
Date Sun, 9 Sep 2012 19:07:06 +0200
Subject Re: What’s the differences between these two pieces of code ?
From Kwpolska <kwpolska@gmail.com>
To iMath <redstone-cold@163.com>
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.422.1347210429.27098.python-list@python.org> (permalink)
Lines 43
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1347210429 news.xs4all.nl 6975 [2001:888:2000:d::a6]:59416
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:28787

Show key headers only | View raw


On Sun, Sep 9, 2012 at 3:27 PM, iMath <redstone-cold@163.com> wrote:
> 在 2012年7月7日星期六UTC+8下午12时56分35秒,iMath写道:
>> What’s the differences between these two  pieces of code ?
>>
>> (1)
>>
>> for i in range(1, 7):
>>
>> print(2 * i, end='   ')
>>
>>
>>
>> thx everyone
>>
>> (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  ?
>
> --
> http://mail.python.org/mailman/listinfo/python-list

Well, (2) is inserting an additional newline, and (1) isn’t.  The
shell might not show that, but try running this as a standalone
script.

-- 
Kwpolska <http://kwpolska.tk>
stop html mail      | always bottom-post
www.asciiribbon.org | www.netmeister.org/news/learn2quote.html
GPG KEY: 5EAAEA16

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


Thread

Re: What’s the differences between these two  pieces of code ? iMath <redstone-cold@163.com> - 2012-09-09 06:27 -0700
  Re: What’s the differences between these two pieces of code ? Kwpolska <kwpolska@gmail.com> - 2012-09-09 19:07 +0200

csiph-web