1 00:00:10,330 --> 00:00:15,920 Hello, boys, in this tutorial, we are going to learn about the comment in Python. 2 00:00:16,330 --> 00:00:25,200 So what are the comments, comments in Python or in any programming language in general or just a text 3 00:00:25,200 --> 00:00:29,380 in a program or get a text in a program that used to explain the code? 4 00:00:29,400 --> 00:00:37,370 OK, and in computer programming in general, the comment is a reasonable explanation of a code. 5 00:00:37,710 --> 00:00:42,570 And these comments make source code easier to understand for us. 6 00:00:42,720 --> 00:00:50,850 And these comments are also ignored by interpreters or the compilers in programming languages and comments 7 00:00:50,850 --> 00:00:59,340 in Python like it's obviously used to explain code and make our code more readable doors and other people 8 00:00:59,340 --> 00:01:01,620 who are working on the project. 9 00:01:01,980 --> 00:01:03,610 So let's see with some examples. 10 00:01:03,630 --> 00:01:07,010 OK, now let's start with this. 11 00:01:07,020 --> 00:01:08,510 Let's start one comment here. 12 00:01:08,700 --> 00:01:11,730 So I started this has the Hassane, OK? 13 00:01:12,000 --> 00:01:14,400 And let's put something here. 14 00:01:15,130 --> 00:01:16,380 Let's something. 15 00:01:24,450 --> 00:01:33,150 So now when we bring this program, we will get out here by an interpreter, ignore this comment, and 16 00:01:33,150 --> 00:01:36,280 it will only give you the outlook of this program. 17 00:01:36,300 --> 00:01:42,660 OK, so let's plan this and you can see the output and there is no comment in the in the output. 18 00:01:42,710 --> 00:01:46,340 OK, so let's put another comment here, OK? 19 00:01:48,380 --> 00:01:56,260 This is a greeting, and now, again, if I bring this again, we will just get the output, which is 20 00:01:56,260 --> 00:01:59,610 this, and we will not get again. 21 00:01:59,620 --> 00:02:03,820 The comments about this will be ignored by the Python interpreter. 22 00:02:04,150 --> 00:02:06,860 And that is the whole point of this comment. 23 00:02:06,890 --> 00:02:16,850 OK, the whole point of the comments in any language is to explain or make the code more readable. 24 00:02:16,870 --> 00:02:25,000 OK, sometimes what happens when you work on the project, sometimes you need to remember the document, 25 00:02:25,090 --> 00:02:26,320 what the board is for. 26 00:02:26,390 --> 00:02:30,940 OK, sometimes you need to remember that this code is for that purpose. 27 00:02:30,990 --> 00:02:37,480 OK, so we will get to understand what the code represents and that is the whole use of documents in 28 00:02:37,750 --> 00:02:41,680 any language, in any programming languages and then also Python. 29 00:02:42,250 --> 00:02:45,670 So start the comment with this hash sign and then to come in. 30 00:02:46,300 --> 00:02:50,050 And also you can place the comments at the end of the call. 31 00:02:50,080 --> 00:02:59,830 OK, so let's put another comment at the end of this program and we can see that we can use the comments 32 00:02:59,830 --> 00:03:02,910 at the start of this program or the end of the program. 33 00:03:06,190 --> 00:03:10,840 We can also use common sense to stop the execution of a. 34 00:03:11,130 --> 00:03:13,450 OK, so let's see how. 35 00:03:15,870 --> 00:03:19,080 So reveal the program, right? 36 00:03:19,620 --> 00:03:25,610 OK, and then let's get out of this program and we will get out. 37 00:03:26,370 --> 00:03:27,600 What do we want? 38 00:03:27,720 --> 00:03:29,900 Don't want to execute this program. 39 00:03:30,450 --> 00:03:36,690 You if you want to stop the execution of this program so you can use the comment, OK? 40 00:03:37,200 --> 00:03:39,090 And now we've put in this. 41 00:03:39,090 --> 00:03:40,080 It will be empty. 42 00:03:40,330 --> 00:03:42,540 As you can see in the terminal. 43 00:03:42,740 --> 00:03:43,660 It's empty. 44 00:03:43,710 --> 00:03:52,110 OK, so you can stop the execution of the program using the comment in front of this prison. 45 00:03:52,920 --> 00:03:54,810 And again, I've done this. 46 00:03:54,960 --> 00:04:01,180 I only get to get this this output without you, without the comment, OK? 47 00:04:01,470 --> 00:04:06,420 And we will not get this output which has come in. 48 00:04:06,780 --> 00:04:07,050 OK. 49 00:04:14,560 --> 00:04:19,570 Well, now let's talk about the multiline comments in Britain. 50 00:04:19,600 --> 00:04:30,190 Britain does not help Syntex for multiline comments and the multiline comment you could insert or hassane 51 00:04:31,120 --> 00:04:41,260 for each line like this, you could use the Hassane, each line like this or or we can use it another 52 00:04:41,260 --> 00:04:41,540 way. 53 00:04:42,670 --> 00:04:52,410 So we fibrin this not only to print the program like this and we will get the output comment and it 54 00:04:52,420 --> 00:04:53,440 will be not printed. 55 00:04:53,820 --> 00:04:54,160 Right. 56 00:04:54,580 --> 00:04:58,030 So there is another way to read this comment. 57 00:04:58,300 --> 00:05:01,060 Python interpreter ignored three literals. 58 00:05:01,060 --> 00:05:01,310 Right. 59 00:05:01,660 --> 00:05:09,430 String literals or quotes and that are not assigned to variable strings which are not assigned to the 60 00:05:09,430 --> 00:05:12,960 variables are ignored by the Python interpreter. 61 00:05:13,090 --> 00:05:23,250 So you can use the multiple string like a triple codes, like a tuple course like this to and placed 62 00:05:23,290 --> 00:05:24,730 the documents inside this. 63 00:05:35,500 --> 00:05:39,130 As you can see, this is a triple coated string, OK? 64 00:05:39,460 --> 00:05:44,960 And it is not assigned to the variable and we can use this as a comment. 65 00:05:44,980 --> 00:05:51,790 OK, so as long as this string is not assigned to the variable, the Python interpreter will read the 66 00:05:51,790 --> 00:05:54,560 code and it will ignore it. 67 00:05:54,580 --> 00:06:01,930 OK, again, you can see here in the terminal we only get the output which is printed. 68 00:06:02,200 --> 00:06:03,770 So there is to it. 69 00:06:03,770 --> 00:06:13,600 The first one is Asain or Hassane at each line and you can use to pull quotes to the multiline comments.