comment out multiple lines python code example
Example 1: python if statement multiple lines
if (cond1 == 'val1' and cond2 == 'val2' and
cond3 == 'val3' and cond4 == 'val4'):
do_something
if (
cond1 == 'val1' and cond2 == 'val2' and
cond3 == 'val3' and cond4 == 'val4'
):
do_something
if (cond1 == 'val1' and cond2 == 'val2' and
cond3 == 'val3' and cond4 == 'val4'):
do_something
Example 2: multiline comment python
'''
inside a multi-line string!
Just wrap the comment in the three single quote marks,
And
you're
good
to
go!
'''
Example 3: python comment multiple lines
'''
Technically you could also use triple single quotation
marks like so, but this formatting does not count
as "true" source code comments that are removed by
a Python parser.
'''
Example 4: python big comment
"""
3 quote marks is technically
a docstring, but it works as
a multi line comment
"""
and 'Alt 4' to uncomment
if False:
print('Hello')
you can technically put if False around code you dont want it to run,
but that would mean it has to have correct syntax,
and would not be good for readability.
Example 5: multiline comment python
Example 6: python multiline comment