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,440 points
96 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,780 points
106 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
• 58,100 points
165 views
+1 vote
1 answer

How to comment multiple lines in Python?

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

answered May 24, 2019 in Python by Nisa
• 180 points
193 views
0 votes
1 answer

How to catch multiple exceptions in one line in python?

From Python Documentation: An except clause may name multiple ...READ MORE

answered Dec 17, 2020 in Python by Gitika
• 65,870 points
151 views
0 votes
1 answer

Is it possible to break a long line to multiple lines in Python?

Example of implicit line continuation: a = some_function( ...READ MORE

answered Jan 4 in Python by Gitika
• 65,870 points
72 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
12,429 views
0 votes
2 answers
+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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,992 views
0 votes
0 answers
+4 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,810 points
1,528 views