1
00:00:00,660 --> 00:00:06,060
One of the best attributes of the good programa is to leave comments and document the code.

2
00:00:06,600 --> 00:00:12,000
So what are the two ways of which you can add comments to Python code?

3
00:00:12,960 --> 00:00:16,890
I brought up one of the scripts that will be playing with later in this course.

4
00:00:17,310 --> 00:00:20,420
And what the script is about doesn't really matter.

5
00:00:20,610 --> 00:00:25,810
But what I want to show you here is that I've got two types of comments integrated.

6
00:00:25,860 --> 00:00:29,880
The first one is about the header of the script.

7
00:00:29,880 --> 00:00:35,520
I'm just going to enlarge the the pain here for the code.

8
00:00:35,520 --> 00:00:40,440
And you can see that in green letters, at least with the theme that I have selected.

9
00:00:40,710 --> 00:00:47,760
I've got lots of text that describes this code and provides some information about the code and how

10
00:00:47,760 --> 00:00:54,900
to use it for the user that will eventually be running this code on their E.S.P three to be considered

11
00:00:55,080 --> 00:01:03,750
at the beginning of this block of text of code three single quote marks and the end is marked by another

12
00:01:03,900 --> 00:01:06,010
three single code marks.

13
00:01:06,120 --> 00:01:12,270
So just three marks like that will create a block the beginning of the end.

14
00:01:12,270 --> 00:01:14,250
You need to have those three quotation marks.

15
00:01:15,030 --> 00:01:18,300
This is a useful way to add comments.

16
00:01:18,300 --> 00:01:26,130
If you are planning to have comments that span over multiple lines, if you just want to have a small

17
00:01:26,130 --> 00:01:35,400
amount of text for a comment, then you can use a comment that starts with a sharp symbol and that is

18
00:01:35,400 --> 00:01:36,870
followed by the text.

19
00:01:37,200 --> 00:01:44,160
And you can have this kind of comment at the beginning of a line or sitting on its own like this, for

20
00:01:44,190 --> 00:01:48,000
you can make it part of a line of code.

21
00:01:48,000 --> 00:01:58,040
You can comment that line of code by adding that code at the end of a coalition comment like this.

22
00:01:58,740 --> 00:02:06,870
So I typically begin my scripts with a header which contains comments over multiple lines, provides

23
00:02:06,870 --> 00:02:13,770
as much documentation as I can that I think is going to be useful for the end user of the code.

24
00:02:14,160 --> 00:02:19,470
And very often I also add comments integrated inside the code itself.

25
00:02:19,470 --> 00:02:25,950
Using this single sharp symbol very often depends on how much I want to write, either sitting on its

26
00:02:25,950 --> 00:02:31,980
own line or I add a comment after the actual python.

27
00:02:32,780 --> 00:02:33,640
On the same love.
