Skip to main content

Python Comments

Comments can be used to user can easily understand the code it is not printed on the output.

There are two types of comments

1.     Single line comment

2.     Multi line comment

1. Single line comment:

         By using single line comment we can write single line of comment only.

            It can be represented as # symbol

2. Multi line comment:

            By using multi line comment we can write multiple lines of comments.

            It can be represented as triple double quotes(‘’’)

Note: Comments are not printed on the output.

Program:

a=10 #Assign a value as 10

print(a)

'''

 print function is

 used to print the

 statements

'''

print('GPR Computers')

output:

10

GPR Computers


Comments