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?
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.
This is a multiline
comment. I can ...READ MORE
''' This is a multiline comment. ...READ MORE
Comments in Python begin with a # ...READ MORE
From Python Documentation:
An except clause may name multiple ...READ MORE
Example of implicit line continuation:
a = some_function(
Firstly we will import pandas to read ...READ MORE
You can also use the random library's ...READ MORE
colors = ['red', 'green', ...READ MORE
can you give an example using a ...READ MORE
You can simply the built-in function in ...READ MORE
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.