1 00:00:00,810 --> 00:00:03,060 Biton statements and comments. 2 00:00:04,320 --> 00:00:11,100 So at first, we're discussing Biton statement instructions that a Python interpreter can execute will 3 00:00:11,100 --> 00:00:12,660 be known as a statement. 4 00:00:13,020 --> 00:00:20,520 For example, say count is a glucan, is an assignment, statement if statement, false statement while 5 00:00:20,520 --> 00:00:21,930 statement, etc.. 6 00:00:21,940 --> 00:00:23,700 So these are the examples of statement. 7 00:00:24,690 --> 00:00:27,220 You can also issue multiline statements. 8 00:00:27,240 --> 00:00:31,920 So that means in Python, end of a statement is marked by a new line character. 9 00:00:32,250 --> 00:00:39,990 But we can make a statement in it over multiple lines with the line condition marker that is our backslash 10 00:00:39,990 --> 00:00:40,170 here. 11 00:00:40,560 --> 00:00:42,630 So for example, you can consider this. 12 00:00:42,900 --> 00:00:48,060 Let us suppose I want to write welcome to the world of programming, but due to some design, I do not 13 00:00:48,060 --> 00:00:50,450 want to write this statement in one line. 14 00:00:50,580 --> 00:00:52,740 I want to break it up into multiple lines. 15 00:00:52,740 --> 00:00:57,180 In that case, we are supposed to put one continuation marker at the end of the statement. 16 00:00:57,420 --> 00:00:58,770 That is our backslash. 17 00:00:58,980 --> 00:01:03,960 So in this way, if you go on writing that interpreter, you'll think will consider this particular 18 00:01:03,960 --> 00:01:04,340 line. 19 00:01:04,560 --> 00:01:09,590 That is a line statement is nothing but a single line statement and it will get executed accordingly. 20 00:01:11,580 --> 00:01:13,980 Next, we are going for Biton indentation. 21 00:01:14,020 --> 00:01:17,710 So that is very interesting, despite an indentation is very interesting. 22 00:01:18,060 --> 00:01:24,930 So like other programming languages as example C or C++ or Java, we use Karlee process to denote a 23 00:01:24,930 --> 00:01:27,950 block to define a block of code. 24 00:01:27,960 --> 00:01:32,030 But I use Python uses indentation. 25 00:01:32,370 --> 00:01:37,810 So as this particular example, you just see that this part is starting with this particular indentation. 26 00:01:38,250 --> 00:01:39,350 This is the inner four. 27 00:01:39,360 --> 00:01:41,030 There is a nested for, we can say. 28 00:01:41,340 --> 00:01:44,320 So that's why it is having a different indentation here. 29 00:01:44,880 --> 00:01:53,050 This print, Ikoma G is within this nested for that within this within the body of the inner four. 30 00:01:53,190 --> 00:01:55,480 So that's why it is having another indentation. 31 00:01:55,860 --> 00:01:56,940 So what is happening? 32 00:01:57,210 --> 00:02:04,980 We are not supposed to put any begin or end any curlew process to denote the block begin and block and 33 00:02:04,980 --> 00:02:05,670 markers. 34 00:02:06,030 --> 00:02:08,280 That scope is not there in Python. 35 00:02:08,520 --> 00:02:14,820 That indentation will make us feel that this particular statement or these are the set of statements 36 00:02:14,850 --> 00:02:17,030 are under one block. 37 00:02:17,160 --> 00:02:19,610 So they will have a separate indentation. 38 00:02:19,950 --> 00:02:25,050 So intent and update will be very much interesting in python coding. 39 00:02:26,910 --> 00:02:34,050 Next one, we are having the Python comments, so in Python, use the simple hash, so this has to start 40 00:02:34,260 --> 00:02:35,850 writing a line comment. 41 00:02:35,920 --> 00:02:40,130 So whenever we are supposed to write a comment line, so comment line is very important. 42 00:02:40,140 --> 00:02:42,270 So they pick the purpose of the program. 43 00:02:42,480 --> 00:02:45,260 It will depict the purpose of a block code. 44 00:02:45,320 --> 00:02:50,600 So comment insertion of common in our programming is a good programmers practice. 45 00:02:50,940 --> 00:02:53,610 So that's why how to write this single line comment. 46 00:02:53,730 --> 00:02:58,860 So in that case, the comment line must be preceded by the hash symbol in case of Python. 47 00:02:59,100 --> 00:03:04,650 Different languages that have different syntax has to write the respective single end comment. 48 00:03:04,770 --> 00:03:09,050 But in Python it is starting with this preceded by this symbol. 49 00:03:10,460 --> 00:03:15,230 Whenever you are supposed to write multiline comments like this mountable line Sadir in the comment 50 00:03:15,230 --> 00:03:22,310 block, so if we have comments that extend multiple lines, one way of doing it to use symbol at the 51 00:03:22,310 --> 00:03:23,970 beginning of each and every line. 52 00:03:24,140 --> 00:03:25,110 Consider this one. 53 00:03:25,490 --> 00:03:27,580 So here you are having the line come in. 54 00:03:27,680 --> 00:03:32,170 So in this program, we have used functions and iterations so it can be enclosed. 55 00:03:32,180 --> 00:03:37,110 It can be done in this way that for each and every line at the beginning are putting the hash symbol. 56 00:03:37,700 --> 00:03:45,290 Another way of doing this is to use a triple kautz, either using the single triple or double quotes 57 00:03:45,440 --> 00:03:46,190 three times. 58 00:03:46,460 --> 00:03:53,720 So this triple courts are generally used to multiline strings, but they can be used as multiline comment 59 00:03:53,720 --> 00:03:57,110 as well, unless they are not doch string. 60 00:03:57,110 --> 00:04:02,940 What is a string will be coming in the next slide and they do not generate an extra code as example. 61 00:04:02,960 --> 00:04:05,930 So now here you see there is a multiline come in. 62 00:04:05,930 --> 00:04:11,910 I can have multiple number of lines there, but the first line will have will be presented by this trist 63 00:04:11,960 --> 00:04:16,640 single code and the last line will be having that single code at the end. 64 00:04:16,790 --> 00:04:22,070 We can also use double code in place of single code, but in both cases will be using them for three 65 00:04:22,070 --> 00:04:22,420 times. 66 00:04:22,700 --> 00:04:25,070 So that is the way to write the multiple incoming. 67 00:04:26,240 --> 00:04:32,650 So now let me discuss what is a dark string, so dark string is a short form of documentation string, 68 00:04:33,020 --> 00:04:40,150 so it is a string that occurs at the first statement in a model, a function, a class or method definition. 69 00:04:40,160 --> 00:04:41,660 So that should be the first statement. 70 00:04:42,050 --> 00:04:46,470 And we must write what a function class does in the dark string. 71 00:04:46,910 --> 00:04:53,120 So in the string we shall mention the purpose of the respective function or the model or the class. 72 00:04:53,360 --> 00:04:57,260 I think for the better understanding, let us go for some practical demonstration. 73 00:04:57,350 --> 00:04:58,640 And that is the demonstration. 74 00:04:59,620 --> 00:05:05,770 For a single comment, we can use Hash Brown, this comment line, and that will make the line under 75 00:05:05,770 --> 00:05:06,150 comment. 76 00:05:06,580 --> 00:05:11,820 So it has its respective marker, which will indicate that this line is a comedy line. 77 00:05:11,840 --> 00:05:17,120 So during execution, these lines are not going to get executed in case of Microland comment. 78 00:05:17,140 --> 00:05:19,060 We can go for triple double code. 79 00:05:20,090 --> 00:05:26,030 Or you can go for triple single code four, including the block of the text, so if we execute this 80 00:05:26,450 --> 00:05:31,610 this part, we can find that this Martland comments can also be written like this, or this particular 81 00:05:31,610 --> 00:05:35,840 statement will be printed like this one, but it will not be interpreted. 82 00:05:35,840 --> 00:05:38,920 It is just a printing mere printing this line. 83 00:05:39,350 --> 00:05:41,650 So this line is not getting executed here. 84 00:05:42,140 --> 00:05:47,810 So instead of having this triple double code, so you can also go for triple single code here, you 85 00:05:47,810 --> 00:05:50,360 can easily find that I'm just putting triple single code. 86 00:05:53,130 --> 00:05:58,710 So there also I'm going to get the same outcome for the assignment Rickman will be writing rideable 87 00:05:58,710 --> 00:06:02,410 is equal to expression, so expression will always return a value. 88 00:06:02,850 --> 00:06:08,940 So we are having this one that is available in the gallery exhibition in of Biton assignment streetman. 89 00:06:08,950 --> 00:06:14,450 So if I go on executing that one will be assigned to it in case of my statement. 90 00:06:14,610 --> 00:06:18,570 So explicit line contention can be used this splashier. 91 00:06:18,630 --> 00:06:24,700 So this is our backslash so you can find that B is equal to one plus two plus three plus. 92 00:06:24,720 --> 00:06:27,600 So this is a continuation marker four plus plus six. 93 00:06:27,630 --> 00:06:28,360 So what will happen? 94 00:06:28,890 --> 00:06:33,930 It will be considered internally that for part of four, five and six are getting added with this one 95 00:06:33,930 --> 00:06:34,880 plus two plus three. 96 00:06:35,490 --> 00:06:41,340 So I can write in this way, just making a separate new line for four plus five plus six and putting 97 00:06:41,340 --> 00:06:42,740 one contingent marker here. 98 00:06:43,020 --> 00:06:45,660 Other is this four plus five plus six can be written. 99 00:06:45,720 --> 00:06:47,910 I just gently in the previous row. 100 00:06:48,120 --> 00:06:50,040 So now if we print the value of B. 101 00:06:53,080 --> 00:06:59,640 I'm getting the value as this, so there is a 21, I'm getting the value of B because this is my six 102 00:07:00,250 --> 00:07:03,710 and if you go on adding, this is also another 15. 103 00:07:03,730 --> 00:07:05,180 So that is six plus 15. 104 00:07:05,200 --> 00:07:07,120 We're going to get here 21. 105 00:07:07,270 --> 00:07:11,580 So implicit contention is always there if you put brackets. 106 00:07:11,590 --> 00:07:15,180 So that is there is no need to put any any kind of splashier. 107 00:07:15,190 --> 00:07:18,790 So it'll be treated as implicit line contamination. 108 00:07:20,510 --> 00:07:22,920 So if you go on printing, it is printing 21. 109 00:07:23,300 --> 00:07:25,790 So here, if I put the slash, then what will happen? 110 00:07:25,820 --> 00:07:30,460 It will produce the same output, but this slash giving is optional. 111 00:07:30,520 --> 00:07:34,280 This backslash giving is optional because it is enclosed within brackets. 112 00:07:34,280 --> 00:07:36,400 So implicit contention will be there. 113 00:07:36,740 --> 00:07:39,490 What having this one, there is a statement in one line. 114 00:07:39,500 --> 00:07:45,170 So anybody who are trying to write multiple statements in one line, we can separate them by the semicolon 115 00:07:45,170 --> 00:07:45,410 here. 116 00:07:45,800 --> 00:07:53,240 So here you see the if you print the value of D e and if you can find that the respective values are 117 00:07:53,240 --> 00:07:55,230 getting printed, that is one three and zero. 118 00:07:55,610 --> 00:07:58,540 So my statements can be written in a single line. 119 00:07:58,550 --> 00:08:03,980 But here the statements must be separated by the semicolon and in the last statement does not equal 120 00:08:04,100 --> 00:08:04,880 a semicolon here. 121 00:08:05,570 --> 00:08:06,540 So now next one. 122 00:08:06,560 --> 00:08:08,170 So there is a code block. 123 00:08:08,180 --> 00:08:14,540 There is a body of a function loop that starts with the starts with the indentation and ends with the 124 00:08:14,540 --> 00:08:16,520 first on indented line. 125 00:08:16,790 --> 00:08:17,720 So you can find that. 126 00:08:18,200 --> 00:08:20,250 So these are for statement we have written. 127 00:08:20,260 --> 00:08:24,720 So there is the indented line here and this is out of the block we are starting. 128 00:08:24,740 --> 00:08:29,900 So this line has got in the net in that case and is a first on indented statement. 129 00:08:29,910 --> 00:08:34,040 So that means this line is outside of this respective four block. 130 00:08:35,060 --> 00:08:37,070 So in this way we are getting this output equal. 131 00:08:37,070 --> 00:08:42,320 See this line end of the program, this print end of the program is outside of the four blocks. 132 00:08:42,320 --> 00:08:44,270 So that's why it has got printed once only. 133 00:08:44,570 --> 00:08:50,660 So that indicate that which line is under which block are which line is outside of each block. 134 00:08:50,690 --> 00:08:54,260 So that will be decided only by the indentation that is. 135 00:08:54,260 --> 00:08:59,860 No, Culebra says there is no beginning to denote the block begin and block and markers. 136 00:09:00,410 --> 00:09:01,520 Thanks for watching this video.