Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #22181
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <d@davea.name> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.054 |
| X-Spam-Evidence | '*H*': 0.89; '*S*': 0.00; 'interpreter': 0.07; "subject:' ": 0.07; 'subject:Python': 0.07; 'python': 0.11; 'print': 0.15; 'cc:addr:python-list': 0.15; 'dig': 0.16; 'executed': 0.16; 'executes': 0.16; 'received:74.208.4.195': 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:no real name:2**0': 0.26; '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; 'cc:2**0': 0.31; 'source': 0.31; 'produced': 0.32; 'byte': 0.33; 'could': 0.34; 'two': 0.35; 'there': 0.35; 'version': 0.36; 'something': 0.38; 'received:192': 0.39; 'received:192.168.1': 0.40; 'received:192.168': 0.40; 'skip:n 10': 0.62; 'between': 0.64; 'inside': 0.65; 'different': 0.65; 'temporary': 0.66; 'times': 0.66; 'header:Reply-To:1': 0.66; 'reply-to:no real name:2**0': 0.72; "'3'": 0.84; 'davea': 0.84; 'subject:there': 0.84; 'power': 0.87; 'same,': 0.91; 'to:addr:163.com': 0.91; 'hand,': 0.96; 'email addr:163.com': 0.97 |
| Date | Mon, 26 Mar 2012 08:11:03 -0400 |
| From | Dave Angel <d@davea.name> |
| User-Agent | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.27) Gecko/20120216 Thunderbird/3.1.19 |
| MIME-Version | 1.0 |
| To | redstone-cold@163.com |
| Subject | Re: Is there any difference between print 3 and print '3' in Python ? |
| References | <5128580.32.1332762326119.JavaMail.geo-discussion-forums@pbom7> |
| In-Reply-To | <5128580.32.1332762326119.JavaMail.geo-discussion-forums@pbom7> |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Provags-ID | V02:K0:wR8rb6jES1tMeENqSRZDqp3q4ZNFvkLcmeLARcOsyvY 37u3/vKM+qAn7Cy8K7tlt3QAQANDSUtvcKBTGibQAZNDniOp7D EaKGeCJPkxBHlpGZWQsFeMSqfpAaKvwhZ1tI3gX50dn+EvJ9hk Dp5bzn+VHNXfuM79spwf7b3q2vUHbp2492OtXx2bgKHq7nGeSA ibkuua9bMOigulYr68POJYmGQKDDpjXD1K2BIX5Pit+2z4/ev2 gAHzB34LtE+WbWxbFdg0MZONWvDOemO/C+dmy+Prfw3O9Jw2N7 EB0f9PfZQuiEZAg/uGetSvxXX/xMAtfo2V4jGaKCLaGnGFQxg= = |
| Cc | python-list@python.org |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| Reply-To | d@davea.name |
| 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.995.1332763895.3037.python-list@python.org> (permalink) |
| Lines | 26 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1332763895 news.xs4all.nl 6945 [2001:888:2000:d::a6]:43415 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:22181 |
Show key headers only | View raw
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
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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