comment out a block in python
select the lines you want to comment
and 'use Ctrl + / to comment all of the selected text'.
To uncomment do the same thing.
OR
put a '#' before each line
eg : #This is a comment
comment out a block in python
select the lines you want to comment
and 'use Ctrl + / to comment all of the selected text'.
To uncomment do the same thing.
OR
put a '#' before each line
eg : #This is a comment
multiline comment in python
# Python is a language that doesn't support multiline comments
# In languages like JS, single line comments have // in the beginning
# and multiline comments have /* in the beginning
# and */ in the end
# the pound symbol in front of these five lines is the python equivalent of //
print("But there is a workaround!!!")
"""
In python, multiline string is written with 3 double or single quotes,
and the characters in between are treated as an entire string
but, if this string isn't assigned to a variable, python doesnt give any error
It instead ignores the string, similar to the behaviour it would have
towards a comment.
BUT!!!!!
If this is string is put just after defining a function, it is treated as a
docstring, or the documentation string of that function. So, it does have a
meaning and is not exactly ignored by Python
"""
def someFUnc():
"""
Python will treat this as a docstring
"""
pass
print(someFUnc.__doc__)
# OUTPUT:
# Python will treat this as a docstring
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us