Answers for "how to comment multiple lines in python"

2

comment multiple lines in python shortcut

Ctrl+/
For Both:
Ctrl+K+C 
to comment
Ctrl+K+U
To uncomment
Posted by: Guest on May-18-2021
4

python comment

# Single line Comment

"""
	(''' single quotes ''') will also work
	Multi Line
	Comment
"""
Posted by: Guest on November-11-2020
2

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
Posted by: Guest on January-16-2021
4

python comment multiple lines

#This is a comment
#And another one
print("Hello !)  #Comment in the same line
      
"""
A multiline
comment
"""
print("Hello !)
Posted by: Guest on February-13-2021
0

how to comment many lines in python

def windows():
	print('Select the text, Press CTRL + K , C to comment')

 def mac():
	print('Multi-line comment select the lines to be commented. Ctrl + 4.')
Posted by: Guest on March-11-2021
0

comment out multiple lines in python

# This is a "block comment" in Python, made
# out of several single-line comments.
# for this select the code and use shortcut Ctrl + /
Posted by: Guest on November-11-2021

Code answers related to "how to comment multiple lines in python"

Python Answers by Framework

Browse Popular Code Answers by Language