Python

Comments and Types of comments in python

  • Comments are very important  in  writing a program.
  • Python interpreter  ignores comment.
  • In python , commenting  is indicated by ‘#’ ,It is extended till the end of the physical line.
  • Though’ #’ indicates a comment , but when it is written along with string is not considered as a comment.
  • Python supports two types of comments.
  • Single line comments
  • Multi line comments

Single line comments

  • In this type of comment, hash(#) character is followed by the information that explains the further text.
  • In case user wants to specify a single line comment, then comment must start with (#)

Multi-line comments

  • In case if user has the comments that extend to multiple lines , One way of doing this is to use ‘#’ in the beginning of each line.
  • Multi-lined comments  should be given in triple quotes.
Lakshmi Durga

Share
Published by
Lakshmi Durga

Recent Posts

Google Spam Update 2025: Impact, Recovery Guide & SpamBrain Explained

Google released a spam update on 26th of August 2025 and this is affecting a…

2 weeks ago

Google Experiments with Black Sitelink Colors instead of Blue

Google keeps on testing google search display all the time and this time we are…

1 year ago

What are Template Tags in WordPress? How to Use Template Tags

In wordpress if you are developing new or custom wordpress theme or wordpress plugin then…

2 years ago

Google Search Indexing Issues Started on 31st January to February 2024

If you are experiencing indexing issues of your website then you are not alone and…

2 years ago

Create QR Code for Pages & Post using Plugin in WordPress

On your wordpress website if you want to generate qr code for pages and posts…

2 years ago

Add Google Search Console HTML File Upload on WordPress

If you are trying to verify your WordPress website with google search console with html…

2 years ago