Intellipaat Back

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

I have recently started studying Python, but I couldn't find how to implement multi-line comments. Most languages have block comment symbols like

/* 

*/

I tried this in Python, but it throws an error, so this probably is not the correct way. Does Python actually have a multiline comment feature?

1 Answer

0 votes
by (106k points)
edited by

To create a multiline comments in Python you can use triple-quoted strings. You can use either three double-quotes or three triple-quote. 

 s = """ this is a very 

       long string if I had the 

       energy to type more and more ..."""

It is important to indent the leading “""appropriately to avoid an IndentationError.

To know more about this you can have a look at the following video tutorial:-

Learn more about Python from an expert. Enroll in our Python Course!

Related questions

0 votes
1 answer
0 votes
1 answer
+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...