1 00:00:11,970 --> 00:00:17,460 Welcome, welcome, welcome, and this lecture will continue discussing if statements and this will 2 00:00:17,460 --> 00:00:19,350 be the closure of theory. 3 00:00:19,650 --> 00:00:26,060 And first of all, let's begin talking about a term which is called and pass statement. 4 00:00:26,460 --> 00:00:31,140 So the statement is used as a placeholder for future code. 5 00:00:31,680 --> 00:00:41,220 You can see him as a sort of a gate to the flow of code and no active action is made once once it is 6 00:00:41,220 --> 00:00:42,090 executed. 7 00:00:42,480 --> 00:00:47,890 So what actually happens once the code meets these that pass statement? 8 00:00:48,270 --> 00:00:54,030 So first of all, when the first statement is executed and nothing happens, surprising, right. 9 00:00:54,270 --> 00:00:57,510 But it has its advantages and it has its purpose. 10 00:00:58,110 --> 00:01:05,760 If used in an if statement, empty code will be allowed, meaning, for example, you have a random 11 00:01:05,760 --> 00:01:06,540 if statement. 12 00:01:07,140 --> 00:01:14,550 So usually you have like if something, for example, bigger than a number, then you put the two dots 13 00:01:14,550 --> 00:01:21,540 and then under the if you put some code, for example, print something, if you leave the place under 14 00:01:21,540 --> 00:01:24,410 the if empty, you will have an error. 15 00:01:24,540 --> 00:01:26,160 We will see it in a few minutes. 16 00:01:26,550 --> 00:01:34,480 So B if the pass statement lets us to leave that place under the if empty without an error. 17 00:01:34,590 --> 00:01:34,950 All right. 18 00:01:35,520 --> 00:01:41,550 So the third Thurbert, without bas having an empty code under the F will raise an error. 19 00:01:42,060 --> 00:01:47,350 And also that allows you to take a passive approach in if statements. 20 00:01:48,090 --> 00:01:48,370 All right. 21 00:01:48,390 --> 00:01:51,120 So let's see some examples right here. 22 00:01:51,810 --> 00:01:52,140 All right. 23 00:01:52,150 --> 00:01:57,870 So here we have an example of an if statement, really simple one. 24 00:01:57,870 --> 00:01:59,910 We have A equals thirty three. 25 00:02:00,150 --> 00:02:01,770 B equals two hundred. 26 00:02:01,980 --> 00:02:07,350 And right here under the if we stay here, if B bigger than A, which is true. 27 00:02:07,620 --> 00:02:10,140 So we want some code to be executed. 28 00:02:10,380 --> 00:02:14,900 So you can see here let the part if empty without a print action. 29 00:02:14,910 --> 00:02:19,410 So under the F right here we don't have anything, we don't have any print, we don't have nothing. 30 00:02:20,250 --> 00:02:25,530 Also Bas is missing and you can see a small error marker appears. 31 00:02:25,530 --> 00:02:28,240 You can see the small red marker right here. 32 00:02:28,530 --> 00:02:35,880 This means we have some error in the code and once we execute the code, we simply get that syntax error. 33 00:02:36,030 --> 00:02:43,800 OK, so our execution fails because we haven't put anything under the IF and this is a wrong approach 34 00:02:43,800 --> 00:02:44,650 for coding. 35 00:02:44,670 --> 00:02:45,060 All right. 36 00:02:45,060 --> 00:02:51,300 You want to be the best, so you don't want to be to do these kinds of mistakes, having some syntax 37 00:02:51,300 --> 00:02:53,490 errors as simple as that. 38 00:02:53,760 --> 00:02:54,060 All right. 39 00:02:54,070 --> 00:03:01,350 So this example is without having anything under the F, and this gives us a simple error, syntax error. 40 00:03:02,520 --> 00:03:07,080 And right here you can see the second example with the same if condition. 41 00:03:07,080 --> 00:03:11,520 And you can see also under the if we don't have any print, we don't have anything here. 42 00:03:12,510 --> 00:03:15,150 We just added a statement mentioned here. 43 00:03:15,330 --> 00:03:21,210 And you can see there is no red marker that indicates of a code error right here. 44 00:03:21,600 --> 00:03:29,430 And also, once we execute this code you see here, process finishes finished with exit code zero. 45 00:03:29,820 --> 00:03:34,380 This means we do not have any error in the code once executing. 46 00:03:35,160 --> 00:03:35,550 All right. 47 00:03:35,560 --> 00:03:43,220 So in some occasions you would like to do nothing once you get inside and if statement or inside an 48 00:03:43,260 --> 00:03:47,490 ELIF or inside and else, you just don't want to do anything. 49 00:03:47,760 --> 00:03:52,480 And the pass statement lets you do it and that's about it. 50 00:03:52,530 --> 00:03:57,770 This is the purpose of BAS and I guess you will see it in the practice part as well. 51 00:03:57,960 --> 00:04:04,320 It's not very complicated, but it is crucial to know it because you're going to use it also in future 52 00:04:04,320 --> 00:04:05,310 topics as well. 53 00:04:05,670 --> 00:04:06,160 All right. 54 00:04:06,210 --> 00:04:08,180 So we're finished with this lecture. 55 00:04:08,190 --> 00:04:09,580 I will see you in the next video. 56 00:04:09,690 --> 00:04:10,200 Thank you.