×

Html & Html5

The World's best Software Development Study Portal

Python Comments


We use ( # )symbol to start writing a comments.Comments are used by programmer for better understanding of a program. Python interpreter ignores this comment.

Here is the example :



comment1


We can see our Python interpreter just neglect commented lines that were starting with '#'.





Python Multi-line Comments


If we want to extends comments in multiple lines, one way of doing it is to use hash(#) in the beginning of each line.

Here is the example:



comment2


We can see in each line our Python interpreter neglect the commented lines which were starting from'#' but we can use also use triple quotes """ or ''' for multiple line comments or can use in Docstrings.

Here is the example :-








python training insitute| Best IT Training classes in Gurgaon | python training