Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in Python by (47.6k points)

OK, I'm aware that triple-quotes strings can serve as multiline comments. For example,

"""Hello, I am a multiline comment"""

and

'''Hello, I am a multiline comment'''

But technically speaking these are strings, correct?

I've googled and read the Python style guide, but I was unable to find a technical answer to why there is no formal implementation of multiline, /* */ type of comments. I have no problem using triple quotes, but I am a little curious as to what led to this design decision.

1 Answer

0 votes
by (106k points)

You can use multi-line strings as multi-line comments. Unless used as docstrings, they generate no code.

Related questions

+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jul 2, 2019 in Python by Sammy (47.6k points)
0 votes
4 answers

Browse Categories

...