1# Python is a language that doesn't support multiline comments
2# In languages like JS, single line comments have // in the beginning
3# and multiline comments have /* in the beginning
4# and */ in the end
5# the pound symbol in front of these five lines is the python equivalent of //
6print("But there is a workaround!!!")
7"""
8In python, multiline string is written with 3 double or single quotes,
9and the characters in between are treated as an entire string
10but, if this string isn't assigned to a variable, python doesnt give any error
11It instead ignores the string, similar to the behaviour it would have
12towards a comment.
13BUT!!!!!
14If this is string is put just after defining a function, it is treated as a
15docstring, or the documentation string of that function. So, it does have a
16meaning and is not exactly ignored by Python
17"""
18def someFUnc():
19 """
20 Python will treat this as a docstring
21 """
22 pass
23
24print(someFUnc.__doc__)
25
26# OUTPUT:
27# Python will treat this as a docstring
1#This is a comment
2#And another one
3print("Hello !) #Comment in the same line
4
5"""
6A multiline
7comment
8"""
9print("Hello !)
1 def windows():
2 print('Select the text, Press CTRL + K , C to comment')
3
4 def mac():
5 print('Multi-line comment select the lines to be commented. Ctrl + 4.')
6
1# This is a "block comment" in Python, made
2# out of several single-line comments.
3# for this select the code and use shortcut Ctrl + /
4