One of the best attributes of the good programa is to leave comments and document the code.
So what are the two ways of which you can add comments to Python code?
I brought up one of the scripts that will be playing with later in this course.
And what the script is about doesn't really matter.
But what I want to show you here is that I've got two types of comments integrated.
The first one is about the header of the script.
I'm just going to enlarge the the pain here for the code.
And you can see that in green letters, at least with the theme that I have selected.
I've got lots of text that describes this code and provides some information about the code and how
to use it for the user that will eventually be running this code on their E.S.P three to be considered
at the beginning of this block of text of code three single quote marks and the end is marked by another
three single code marks.
So just three marks like that will create a block the beginning of the end.
You need to have those three quotation marks.
This is a useful way to add comments.
If you are planning to have comments that span over multiple lines, if you just want to have a small
amount of text for a comment, then you can use a comment that starts with a sharp symbol and that is
followed by the text.
And you can have this kind of comment at the beginning of a line or sitting on its own like this, for
you can make it part of a line of code.
You can comment that line of code by adding that code at the end of a coalition comment like this.
So I typically begin my scripts with a header which contains comments over multiple lines, provides
as much documentation as I can that I think is going to be useful for the end user of the code.
And very often I also add comments integrated inside the code itself.
Using this single sharp symbol very often depends on how much I want to write, either sitting on its
own line or I add a comment after the actual python.
On the same love.