[Tutor] multiline comment in Python
Karl Pflästerer
sigurd at 12move.de
Fri Sep 5 22:21:37 EDT 2003
An unnamed person wrote:
> One example is when I use triple quotes to comment out a block of code
> that already has print statements I had inserted in there earlier for
> debugging purposes, Python will then give me a syntax error. This gets
Can you give an example? For the Python here everything betwenn `"""'
is a string. So why should a print statement matter?
>>> """
... 123
... 3 + 4
... print 27 * 35
... 42
... """
'\n123\n3 + 4\nprint 27 * 35\n42\n'
>>> s = _
>>> s
'\n123\n3 + 4\nprint 27 * 35\n42\n'
>>> print s
123
3 + 4
print 27 * 35
42
>>>
Karl
--
Please do *not* send copies of replies to me.
I read the list
More information about the Tutor
mailing list