Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 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:-

Related questions

0 votes
1 answer
+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94k users

Browse Categories

...