how does not work nested comment in python?

Dave Angel davea at davea.name
Wed Sep 4 08:08:50 EDT 2013


On 4/9/2013 02:13, vnkumbhani at gmail.com wrote:

> example: 
>  
> print "hello" # print comment +"world"    => single line comment

>>> print "hello" # print comment +"world"    => single line comment
hello


> print "hello" '''print comment''' +"world"   => multiple line comment

>>> print "hello" '''print comment''' +"world"   => multiple line comment
  File "<stdin>", line 1
    print "hello" '''print comment''' +"world"   => multiple line comment
                                             ^
SyntaxError: invalid syntax
>>> print "hello" '''print comment''' +"world"
helloprint commentworld

What is your question?  The first line has a comment on it, the second
one does not.

-- 
DaveA





More information about the Python-list mailing list