Custom Search

Python: # Comment

In Python, any line starting with # is a comment.

The computer ignores comments, they are just notes by the code's author to clarify what the code is supposed to do.

Such notes come in very handy as you are writing a program. They make it easy for you to see what you are doing in various parts of the program.

It is good etiquette to leave comments in your work. If you, as the author or someone else as a user of your code needs to change it or adapt it for another task, this is made easier by comments.