How to create Multiline comments in Python
In this tutorial, we are going to learn about how to create a multiline comments in Python.
In Python, we can create a single line comment by using #
character followed by the comment.
# this is a single line comment
Multiline comments
To create a multiline comment, we can use the triple quotes """
syntax in Python.
The triple quotes syntax is normally used to create a multiline strings, but the string literals are ignored that are not assigned to a variable, so we are using it to add a multiline comment.
Here is an example:
"""
you can
see mee
in multiple lines
"""
Note: The multiline comment starts after the """
and ends before the """
.
Any text we can add between """
and """
is ignored by the python compiler