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: 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: =?UTF-8?Q?Re=3A_What=E2=80=99s_the_differences_between_these_two_piece?= =?UTF-8?Q?s_of_code_=3F?= From: Kwpolska To: iMath 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Sun, Sep 9, 2012 at 3:27 PM, iMath wrote: > =E5=9C=A8 2012=E5=B9=B47=E6=9C=887=E6=97=A5=E6=98=9F=E6=9C=9F=E5=85=ADUTC= +8=E4=B8=8B=E5=8D=8812=E6=97=B656=E5=88=8635=E7=A7=92=EF=BC=8CiMath=E5=86= =99=E9=81=93=EF=BC=9A >> What=E2=80=99s the differences between these two pieces of code ? >> >> (1) >> >> for i in range(1, 7): >> >> print(2 * i, end=3D' ') >> >> >> >> thx everyone >> >> (2) >> >> for i in range(1, 7): >> >> print(2 * i, end=3D' ') >> >> print() >> >> >> >> >> >> when executed both respectively in Python shell ,I get the same effec= t . Who can tell me why ? > > -- > http://mail.python.org/mailman/listinfo/python-list Well, (2) is inserting an additional newline, and (1) isn=E2=80=99t. The shell might not show that, but try running this as a standalone script. --=20 Kwpolska stop html mail | always bottom-post www.asciiribbon.org | www.netmeister.org/news/learn2quote.html GPG KEY: 5EAAEA16