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 28, 2018 in Python by anto.trigg4
• 3,440 points
433 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 28, 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 31, 2018 in Python by charlie_brown
• 7,720 points
376 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,090 points
760 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
888 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,910 points
4,824 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, 2021 in Python by Gitika
• 65,910 points
1,007 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
14,787 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 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,058 views
0 votes
1 answer
+5 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,790 points
3,477 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP