Python Comments


Comment in python is the hidden code that is not interpreted by the interpreter and used to explain the program code.

Although comments are not the necessary part of a program but it improves the readability of our program and makes the program more easily understandable to everyone.

Like many other programming languages, python also supports 2 types of comments which are as follows:

1. Single line comment

It is used to comment only a single line of code in our program. The # (hash) is used for a single line comment.

Example

#This is a single line comment


2. Multi-line comment

It is used to comment multiple lines of code in our program. A multiple line comment is enclosed in triple quotes (”””).

Example

    ”””This is
    a multiline
    comment”””