multiline comments

Jorge Godoy godoy at ieee.org
Wed Apr 19 14:47:58 EDT 2006


rx wrote:

> 
> "Jorge Godoy" <godoy at ieee.org> wrote in message
> news:2145108.A1WUCsNlIN at jupiter.g2ctech...
>> Edward Elliott wrote:
>>
> 
>>
>> You can use either """ or '''.  I don't keep changing them in my code, so
>> I
>> can always use the other type (usually I use " so for commenting things
>> out
>> I'd use ') to do that.
>>
> 
> Try that on this code:
> 
> a=3
> a=a*a
> b='''This is a
>     very long
>     long
>     text'''
> print a
> 
> 
> like:
> 
> a=3
> '''
> a=a*a
> b='''This is a
>     very long
>     long
>     text'''
> '''
> print a
> 
> 
> 
> raises SyntaxError

Of course!  You should have used """ since you already used ''' in your
triple-quoted text.  But I'm just repeating what I already said (and kept
above so that you can see it again).

-- 
Jorge Godoy      <godoy at ieee.org>

"Quidquid latine dictum sit, altum sonatur."
- Qualquer coisa dita em latim soa profundo.
- Anything said in Latin sounds smart.



More information about the Python-list mailing list