[Tutor] Logging with proper format

Kent Johnson kent37 at tds.net
Sun Oct 7 22:32:33 CEST 2007


Eric Brunson wrote:
> claxo wrote:
>> dont indent the line after '\', that means 0 indent
>>
>> s = 'hello\
>> boy'
>>   
> 
> Or, arguably better:
> 
> s = '''hello
> boy'''

That is a different string, it contains a newline, the original does not:

In [20]: s = 'hello\
    ....: boy'
In [21]: s2 = '''hello
    ....: boy'''
In [22]: s==s2
Out[22]: False
In [23]: print s
helloboy
In [24]: print s2
hello
boy


Kent


More information about the Tutor mailing list