1# While Python doesn't support multi-line comments, it can ignore anything
2'''
3inside a multi-line string!
4Just wrap the comment in the three single quote marks,
5And
6you're
7good
8to
9go!
10'''
1#There is no way to comment multiple lines in Python.
2#You just keep using "#" symbol to comment each line out.
3
4'''
5Technically you could also use triple single quotation
6marks like so, but this formatting does not count
7as "true" source code comments that are removed by
8a Python parser.
9'''
1# Python doesn't support multi-line comment blocks out of the box.
2# The recommended way to comment out multiple lines of code in Python is
3# to use consecutive single-line comments.
4# feelsbadman
1#%% There are not multiline comments in python,
2# this # is the only form of commenting but, people use
3# """triple quotes""" for multiline commenting but this
4# is actually a String the interpreter will read and
5# will ocupy memory. If you dont put this kind of string
6# into a variable it will be collected on execution
1# This a comment
2#Or This
3#For a comment written in more than a line
4#You just add triple quotes without assigning it a variable or putting it in a
5#print statement
6'''
7Like This
8But only for Python
9As far as i know
10'''
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