multiline comments

rx do_not_use_this_email at hotmail.com
Wed Apr 19 13:55:36 EDT 2006


"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 





More information about the Python-list mailing list