Python Comment

Python Comment

python comment


Comments in Python can be used to describe any program code. It can also be used to hide code.

Comments are the most useful item of any program. It enables us to understand the way a program works. In Python, any statement written with the # symbol is known as a comment. The interpreter does not interpret the comment.

Annotation is not a part of the program, but it increases the interactivity of the program and makes the program readable.


Python supports two types of comments:

Single Line Comment

If the user wants to specify a single line comment, should the comment begin with? #?

 # This is single line comment.  
 print("Example of python comment " )

Multi Line Comment

Multi-line comments can be given inside triple quotes.

 print "Hello Student, Example of multi line comment"  
  1. '''''This is 
  2. multiline comment'''  














Python Comment Python Comment Reviewed by Sk Jha on October 24, 2019 Rating: 5

No comments:

Powered by Blogger.