Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (50.2k points)
Can anyone tell me how to comment in multiple lines in Python?

1 Answer

0 votes
by (108k points)

In Python, you can use the below-mentioned two ways to comment in multiple lines.

The first way is to insert your multi-line comment within triple quotation marks as shown below:

'''

This is a block comment.

It spans multiple lines.

'''

The second way is to break down your multi-line comment into single lines and use the method for single-line comments. It is as given below:

# This is a "block comment" in Python, made

# out of several single-line comments.

If you are looking for an online course to learn Python, I recommend this Python Online Course program by Intellipaat.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jul 10, 2020 in Python by ashely (50.2k points)

Browse Categories

...