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
• 6,110 points
18 views

2 answers to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 65,850 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,120 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
20 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,290 points
19 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,120 points
32 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
28 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
22 views
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
24 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
• 65,850 points
16 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.