2013/9/4 <vnkumbh...@gmail.com>: > example: > > print "hello" # print comment +"world" => single line comment > print "hello" '''print comment''' +"world" => multiple line comment > -- > https://mail.python.org/mailman/listinfo/python-list
Hi, python only has single line comments, which apply from a "#" to the end of the respective line. There are some possibilities/workarounds/hacks for "commenting out", i.e. (temporarily) disabling, parts of the code if False: <indented original code> Sometimes triple-quoted multiline strings are (mis)used this way """<original code in multiple lines>""" which actually converts the code to a not accessible multiline string. However, triple quoting is not an official means for multiline comments. What you are seeing in your second example is implicit string concatenation (which works regardless of the type of the quotes) - adjacent string literals in the code are joined automatically: >>> "abc" 'def' """ghi""" '''jkl''' 'abcdefghijkl' >>> hth, vbr -- https://mail.python.org/mailman/listinfo/python-list