Path: csiph.com!aioe.org!news.mixmin.net!eweka.nl!hq-usenetpeers.eweka.nl!xlned.com!feeder7.xlned.com!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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'value,': 0.03; 'string.': 0.04; 'escape': 0.07; 'python': 0.09; 'debugger': 0.09; 'subject:string': 0.09; '(assuming': 0.16; 'debugger.': 0.16; 'expression.': 0.16; 'repr()': 0.16; 'skip:> 20': 0.16; 'subject:when': 0.16; 'wrote:': 0.17; 'sends': 0.22; 'mention': 0.23; "python's": 0.23; 'second': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'embedded': 0.27; '>>>>': 0.29; 'case,': 0.29; "skip:' 10": 0.30; 'function': 0.30; 'stuff': 0.30; 'print': 0.32; 'quotes': 0.33; 'turns': 0.33; 'to:addr:python-list': 0.33; 'adds': 0.35; 'but': 0.36; 'characters': 0.36; "didn't": 0.36; 'should': 0.36; 'does': 0.37; 'subject:: ': 0.38; 'nothing': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'world': 0.63; 'email addr:gmail.com': 0.63; 'said:': 0.65; 'header:Reply-To:1': 0.68; 'direct': 0.69; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; 'funny': 0.78 Date: Wed, 02 Jan 2013 09:22:16 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: why the output is different when i am implementig multiline string References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:X/QAV1ArwhHPPgWp1izlYYfW0p+JaAECZQsRxp5BhJn G57cFFSYUc25bXlt5H19fGrqksgjd21lVtGTR5uCpQ6yktvCh2 EOCTkOy63cHmZvwtylPdIfvYNlq+IXXT02xg/j2Bh5q4VucUoh tNgpXTbOjcXCntchCYajIMQj7401vFnxn3YEXTTnHnvxhQZ2dY s5wODAMLEHUf/Lak/n4itGERpShA0FHMyGC9xwHQ8yUWci9k7p oiTw1L9B6p2QnQr2kRb0Esk02pfPND8Gv+gKQxV6CaWzcN1L/i qrbmdxQYPa2F8IIBkidEpJud/S077Q3FeI9+8cXGfuVv4Rbdw= = X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: d@davea.name 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: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1357136556 news.xs4all.nl 6885 [2001:888:2000:d::a6]:44421 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35990 On 01/02/2013 09:00 AM, stringsatif1@gmail.com wrote: >>>> '''hello > world''' > 'hello\nworld' >>>> fred=''' hello > world''' >>>> print(fred) > hello > world What you're seeing has nothing to do with the triple quotes, and everything to do with how you're using the debugger. In one case, you just mention a value, and the debugger magically calls repr() on the expression. So it adds quotes around it, and turns embedded funny stuff into escape sequences, because that's what repr() does on a string. In the second case, you call Python's print function (assuming python 3, which you didn't specify). it does not call repr(), but just sends the characters direct to the console. if you want to see the escape characters in the second case, you should have either said: >>>fred or >>>print(repr(fred)) -- DaveA