Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion What’s the differences between these two pieces of code ?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Kwpolska  
View profile  
 More options Sep 9 2012, 1:07 pm
Newsgroups: comp.lang.python
From: Kwpolska <kwpol...@gmail.com>
Date: Sun, 9 Sep 2012 19:07:06 +0200
Local: Sun, Sep 9 2012 1:07 pm
Subject: Re: What’s the differences between these two pieces of code ?

On Sun, Sep 9, 2012 at 3:27 PM, iMath <redstone-c...@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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.