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


Groups > comp.lang.python > #22192

Re: Is there any difference between print 3 and print '3' in Python ?

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <redstone-cold@163.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.040
X-Spam-Evidence '*H*': 0.92; '*S*': 0.00; 'subject: ?': 0.05; 'interpreter': 0.07; "subject:' ": 0.07; 'subject:Python': 0.07; 'to:addr:comp.lang.python': 0.09; 'python': 0.11; 'print': 0.15; 'cc:addr:python-list': 0.15; 'dig': 0.16; 'executed': 0.16; 'executes': 0.16; 'subject:between': 0.16; 'output': 0.18; 'resulting': 0.18; 'wrote:': 0.21; 'processor': 0.22; 'produces': 0.22; 'statement': 0.22; 'header:In-Reply-To:1': 0.22; 'header :User-Agent:1': 0.23; 'possibly': 0.23; 'syntax': 0.23; 'input': 0.24; 'error': 0.25; 'cc:addr:python.org': 0.27; '(by': 0.29; 'code': 0.29; 'file': 0.29; 'asking': 0.29; 'machine': 0.29; 'character': 0.30; 'points': 0.30; 'source': 0.31; 'received:209.85': 0.32; 'received:google.com': 0.32; 'produced': 0.32; 'byte': 0.33; 'cc:2**2': 0.33; 'could': 0.34; 'received:209': 0.35; 'two': 0.35; 'there': 0.35; 'version': 0.36; 'really': 0.36; 'something': 0.38; 'think': 0.40; 'skip:n 10': 0.62; 'between': 0.64; 'inside': 0.65; 'different': 0.65; 'temporary': 0.66; 'times': 0.66; 'from:no real name:2**0': 0.67; 'from:addr:163.com': 0.70; "'3'": 0.84; 'davea': 0.84; 'skip:2 50': 0.84; 'subject:there': 0.84; 'power': 0.87; 'cc:no real name:2**2': 0.91; 'same,': 0.91; 'hand,': 0.96; 'email addr:163.com': 0.97
Newsgroups comp.lang.python
Date Mon, 26 Mar 2012 07:28:25 -0700 (PDT)
In-Reply-To <mailman.995.1332763895.3037.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=65.49.68.171; posting-account=Z1-aQQoAAADvnuKxr9sysEiuPIcBNfjX
References <5128580.32.1332762326119.JavaMail.geo-discussion-forums@pbom7> <mailman.995.1332763895.3037.python-list@python.org>
User-Agent G2/1.0
X-Google-Web-Client true
MIME-Version 1.0
Subject Re: Is there any difference between print 3 and print '3' in Python ?
From redstone-cold@163.com
To comp.lang.python@googlegroups.com
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
Cc python-list@python.org, d@davea.name, redstone-cold@163.com
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
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>
Message-ID <mailman.1004.1332772679.3037.python-list@python.org> (permalink)
Lines 70
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1332772679 news.xs4all.nl 6957 [2001:888:2000:d::a6]:47092
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:22192

Show key headers only | View raw


在 2012年3月26日星期一UTC+8下午8时11分03秒,Dave Angel写道:
> On 03/26/2012 07:45 AM, redstone-cold@163.com wrote:
> > I know the print statement produces the same result when both of these two instructions are executed ,I just want to know Is there any difference between print 3 and print '3' in Python ?
> 
> This is a non-question.  The input is the same, the output is the same, 
> what else matters?
> 
> On the other hand, if you want to dig deeper, there are lots of differences:
> 
> 1) the former has a shorter source file
> 2) different C code is utilized inside the interpreter
> 3) different machine code executes
> 4) the temporary objects created have different id's and types
> 5) different execution times (by a trivial amount)
> 6) it takes different keystrokes to edit the two source files once you 
> want to make it do something useful
> 7) the processor works a little harder on one than the other, possibly 
> resulting in a different power consumption
> 8) different byte code is produced
> 
> Or you could be asking about Python version 3, in which case
> 1) the syntax error message points to a different character
> 
> -- 
> 
> DaveA



在 2012年3月26日星期一UTC+8下午8时11分03秒,Dave Angel写道:
> On 03/26/2012 07:45 AM, redstone-cold@163.com wrote:
> > I know the print statement produces the same result when both of these two instructions are executed ,I just want to know Is there any difference between print 3 and print '3' in Python ?
> 
> This is a non-question.  The input is the same, the output is the same, 
> what else matters?
> 
> On the other hand, if you want to dig deeper, there are lots of differences:
> 
> 1) the former has a shorter source file
> 2) different C code is utilized inside the interpreter
> 3) different machine code executes
> 4) the temporary objects created have different id's and types
> 5) different execution times (by a trivial amount)
> 6) it takes different keystrokes to edit the two source files once you 
> want to make it do something useful
> 7) the processor works a little harder on one than the other, possibly 
> resulting in a different power consumption
> 8) different byte code is produced
> 
> Or you could be asking about Python version 3, in which case
> 1) the syntax error message points to a different character
> 
> -- 
> 
> DaveA

Oh ,God !  I think this is what I really want to know ,thank you very much !

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


Thread

Is there any difference between print 3 and print '3' in Python ? redstone-cold@163.com - 2012-03-26 04:45 -0700
  Re: Is there any difference between print 3 and print '3' in Python ? Chris Angelico <rosuav@gmail.com> - 2012-03-26 23:01 +1100
  Re: Is there any difference between print 3 and print '3' in Python ? Kiuhnm <kiuhnm03.4t.yahoo.it> - 2012-03-26 14:07 +0200
  Re: Is there any difference between print 3 and print '3' in Python ? Robert Kern <robert.kern@gmail.com> - 2012-03-26 13:10 +0100
  Re: Is there any difference between print 3 and print '3' in Python ? Dave Angel <d@davea.name> - 2012-03-26 08:11 -0400
    Re: Is there any difference between print 3 and print '3' in Python ? redstone-cold@163.com - 2012-03-26 07:28 -0700
      Re: Is there any difference between print 3 and print '3' in Python ? Stefan Behnel <stefan_ml@behnel.de> - 2012-03-26 17:03 +0200
    Re: Is there any difference between print 3 and print '3' in Python ? redstone-cold@163.com - 2012-03-26 07:28 -0700
    Re: Is there any difference between print 3 and print '3' in Python ? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-03-27 03:43 +0000
      Re: Is there any difference between print 3 and print '3' in Python ? rusi <rustompmody@gmail.com> - 2012-03-26 22:00 -0700
  Re: Is there any difference between print 3 and print '3' in Python ? Terry Reedy <tjreedy@udel.edu> - 2012-03-26 11:45 -0400
  Re: Is there any difference between print 3 and print '3' in Python ? "J. Cliff Dyer" <jcd@sdf.lonestar.org> - 2012-03-26 13:06 -0400
  Re: Is there any difference between print 3 and print '3' in Python ? Peter Otten <__peter__@web.de> - 2012-03-26 19:20 +0200

csiph-web