Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'string.': 0.04; 'subject:Python': 0.05; 'converts': 0.07; 'executed': 0.07; "subject:' ": 0.07; 'python': 0.09; 'thx': 0.09; 'result.': 0.15; 'from:addr:ian': 0.16; 'screen,': 0.16; 'subject:between': 0.16; 'string': 0.17; 'wrote:': 0.17; 'integer': 0.17; 'produces': 0.22; 'statement': 0.23; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'received:208.97': 0.29; 'received:208.97.132': 0.29; 'received:dreamhost.com': 0.29; 'received:g.dreamhost.com': 0.29; 'print': 0.32; 'to:addr:python-list': 0.33; 'everyone': 0.33; 'there': 0.35; 'display': 0.36; 'two': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'between': 0.63; 'received:208': 0.63; 'subject:there': 0.65; "'3'": 0.84; 'received:208.97.132.66': 0.84; 'subject:any': 0.84; '8bit%:67': 0.93 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=feete.org; h=message-id :date:from:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; s=feete.org; bh=fz+SvCh 1J/Mzvxz8a3eW2yJM07I=; b=eoPu4A6PaqWCwZAvDlZNIGFFB4wxAgdeuQFXc+C I3r2CkN9KBab66Pno+QGZs8FdzSwb+H8b1yg8+zAbpwUPzlumzRI2QfNeCPNiO5n TDHTvM2u2PROUn+uZwYvtTcO81p+xctNUJ9n/smzNB0o/+dZ9xgGPonjkOzJSoU6 g24s= Date: Sun, 09 Sep 2012 15:41:46 +0100 From: Ian Foote User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Is there any difference between print 3 and print '3' in Python ? References: <5128580.32.1332762326119.JavaMail.geo-discussion-forums@pbom7> <645baeaa-438e-4d30-a559-0db4231ede9c@googlegroups.com> In-Reply-To: <645baeaa-438e-4d30-a559-0db4231ede9c@googlegroups.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1347201717 news.xs4all.nl 6977 [2001:888:2000:d::a6]:60407 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:28781 On 09/09/12 14:23, iMath wrote: > =E5=9C=A8 2012=E5=B9=B43=E6=9C=8826=E6=97=A5=E6=98=9F=E6=9C=9F=E4=B8=80= UTC+8=E4=B8=8B=E5=8D=887=E6=97=B645=E5=88=8626=E7=A7=92=EF=BC=8CiMath=E5=86= =99=E9=81=93=EF=BC=9A >> 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 differen= ce between print 3 and print '3' in Python ? > thx everyone The difference is that 3 is an integer whereas '3' is a string. The=20 print statement (function in python 3) converts any object to a string=20 before displaying it on the screen, so print 3 and print '3' both=20 display the same result. Ian F