multi line comment

0 votes
I am beginner in python and I am not able to find how can we comment multiple lines. everywhere its either # or /*. This do works for single line but what about multiple lines?
Apr 17, 2018 in Python by ana1504.k
• 7,870 points
23 views

2 answers to this question.

0 votes

There is nothing called multi-line comment in python. Python by default does not contain special characters to make multi-line comments but still you can comment lines in the following way:

'''

This is a mutli-line comment.

it uses single quotes. 

there is another way you can do it

'''

or you can do it like this

"""

This is a mutli-line comment.

it uses double quotes. 

this is the other way you can do it

"""

When you use quotes, it is treated as a regular string but because it is not used in combination with printing statement or for any other task, it works like a multi-line comment

answered Jul 16, 2018 by Omkar
• 67,290 points
0 votes

‘’’

This is the way to

Enter multi line

Comment in Python

‘’’

"""

This is the way to

Enter multi line

Comment in Python

"""

answered Jul 16, 2018 by Priyaj
• 56,200 points

Related Questions In Python

0 votes
1 answer

Multiple line comment in Python

Try this ''' This is a multiline comment. I can ...READ MORE

answered May 30, 2018 in Python by charlie_brown
• 7,710 points
26 views
0 votes
1 answer

Multiple line comment in python

No, you can simply use triple codes ...READ MORE

answered Jun 27, 2018 in Python by v.liyyah
• 1,300 points
26 views
+1 vote
2 answers

Multiple line comment in Python

Try this ''' This is a multiline comment. ...READ MORE

answered Jul 31, 2018 in Python by Priyaj
• 56,200 points
40 views
0 votes
1 answer

Use conditional statements to handle multi-line conditions

You don't need to use 4 spaces ...READ MORE

answered Oct 15, 2018 in Python by charlie_brown
• 7,710 points
38 views
0 votes
1 answer

How to add a new line in Python?

You can use '\n' for a next ...READ MORE

answered May 2, 2018 in Python by aayushi
• 750 points
71 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 169 views
0 votes
1 answer

Multi-threading program in python

import threading import os def task1(): print("Task 1 assigned ...READ MORE

answered Feb 6 in Python by Omkar
• 67,290 points
22 views