Multiple line comment in python

0 votes

I know how to add single line comment but what if I want to comment the whole block of code. Do I need to add # in front of each line?

Jun 27, 2018 in Python by anto.trigg4
• 3,420 points
35 views

1 answer to this question.

0 votes

No, you can simply use triple codes for multi-line comments. For example:

'''

This is my piece of code.

and you can write anything in between.

'''

answered Jun 27, 2018 by v.liyyah
• 1,300 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,720 points
38 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
• 57,300 points
54 views
+1 vote
1 answer

How to comment multiple lines in Python?

Comments in Python begin with a # ...READ MORE

answered May 24 in Python by Nisa
• 180 points
59 views
+3 votes
5 answers

How to read multiple data files in python

Firstly we will import pandas to read ...READ MORE

answered Apr 6, 2018 in Python by DeepCoder786
• 1,720 points
3,151 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
141 views
+1 vote
1 answer

Reading a large file, line by line in Python

The correct, fully Pythonic way to read ...READ MORE

answered Aug 21, 2018 in Python by Priyaj
• 57,300 points
69 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 420 views
+4 votes
6 answers