1 00:00:00,000 --> 00:00:01,200 [no audio] 2 00:00:01,200 --> 00:00:03,100 Friends here we are going to discuss 3 00:00:03,100 --> 00:00:05,600 about Loop Control statements. 4 00:00:06,800 --> 00:00:10,300 See, basically we have two types of Loops in your Python, 5 00:00:10,800 --> 00:00:15,300 right? They are For Loop and While loop. Now we know that 6 00:00:15,300 --> 00:00:18,700 loops are going to repeat for 'n' number of times based on 7 00:00:18,700 --> 00:00:19,700 your condition. 8 00:00:20,500 --> 00:00:22,800 Sometimes one time, sometimes three times, 9 00:00:22,800 --> 00:00:23,800 sometimes hundred times, 10 00:00:23,800 --> 00:00:26,200 sometimes even infinity times you are going to repeat 11 00:00:26,200 --> 00:00:30,900 your logic or you're going to iterate some 'n' number of times. 12 00:00:31,300 --> 00:00:34,800 Let's say a very simple example, suppose if I have a list 13 00:00:35,600 --> 00:00:41,900 consists of, let me take simply some four values, then it is 14 00:00:41,900 --> 00:00:43,700 going to repeat now four times, 15 00:00:44,400 --> 00:00:47,500 and you're going to get numbers 0, 1, 2, 3, 4 times. 16 00:00:48,100 --> 00:00:50,900 So instead of this directly you can write some list also, right? 17 00:00:50,900 --> 00:00:55,800 [no audio] 18 00:00:55,800 --> 00:00:57,700 That's it. Now, let me run it. 19 00:00:58,900 --> 00:01:02,500 Now you're going to repeat, or you are going to iterate, or 20 00:01:02,500 --> 00:01:06,300 you're going to execute this block, how many number of times? 21 00:01:07,200 --> 00:01:11,800 1, 2, 3, 4, 5. Because you have 5 values in your list, 22 00:01:11,800 --> 00:01:14,900 then your loop is going to repeat this block for 5 times, 23 00:01:14,900 --> 00:01:18,700 or your loop is going to iterate this block for 5 times. 24 00:01:20,000 --> 00:01:21,500 Right. That's fine. 25 00:01:22,100 --> 00:01:28,100 But now we have some control statements for your loops means, 26 00:01:28,700 --> 00:01:32,200 to control the iteration part of your loops. 27 00:01:33,200 --> 00:01:36,200 They are like 'break', 'continue'. 28 00:01:37,600 --> 00:01:39,600 Right. Let me explain this here. 29 00:01:40,600 --> 00:01:41,800 So what I am doing is, 30 00:01:41,800 --> 00:01:44,000 [no audio] 31 00:01:44,000 --> 00:01:45,600 see, let me do simply one thing. 32 00:01:47,100 --> 00:01:48,600 I am writing very first line itself 33 00:01:48,600 --> 00:01:51,000 simply 'break', now see the result. 34 00:01:51,000 --> 00:01:52,400 You're not getting any output. 35 00:01:52,900 --> 00:01:56,800 The reason is, first of all 'break' is useful to stop your 36 00:01:56,800 --> 00:01:58,000 iterations in your loop. 37 00:01:59,200 --> 00:02:03,300 Whenever 'break' is encountered, right, simply your Python will 38 00:02:03,300 --> 00:02:05,900 stop the loop part. Suppose 39 00:02:05,900 --> 00:02:09,000 this line is outside of your loop, don't get confused. Stopping 40 00:02:09,000 --> 00:02:12,199 the script is different, stopping the loop is different. 41 00:02:12,800 --> 00:02:14,800 See we know, if you remember somewhere 42 00:02:14,800 --> 00:02:17,500 we imported a module called 'sys', 43 00:02:18,100 --> 00:02:22,200 and then if you remember 'sys.exit' is going to stop your script. 44 00:02:23,000 --> 00:02:25,900 Sorry. Let me save it and run it. 45 00:02:25,900 --> 00:02:27,800 [no audio] 46 00:02:27,800 --> 00:02:29,400 See suppose I am writing here 'print( 47 00:02:30,500 --> 00:02:32,500 "before exit")', 48 00:02:34,000 --> 00:02:35,000 then 'print( 49 00:02:36,100 --> 00:02:37,100 "after 50 00:02:37,100 --> 00:02:39,400 [no audio] 51 00:02:39,500 --> 00:02:40,500 exit")', 52 00:02:41,300 --> 00:02:42,900 then let me write one more line, 53 00:02:42,995 --> 00:02:46,100 this is 'print("after loop")'. 54 00:02:46,500 --> 00:02:47,500 Now see the result. 55 00:02:47,800 --> 00:02:51,700 You are getting, "before exit" only. That means your script is executing 56 00:02:51,700 --> 00:02:53,500 only up to this. In third line 57 00:02:53,500 --> 00:02:56,400 we have 'sys.exit'. Because of that you are going to stop 58 00:02:56,400 --> 00:03:01,400 your entire Python script. Be clear, stopping script is different 59 00:03:01,800 --> 00:03:04,500 stopping loop is different, right. Now, 60 00:03:04,500 --> 00:03:08,500 let me comment or anyway, we don't want this, right, 61 00:03:08,500 --> 00:03:10,400 let me remove all these lines. 62 00:03:10,400 --> 00:03:15,100 [no audio] 63 00:03:15,100 --> 00:03:18,900 Now see the result. Because of 'break' what is happening? 64 00:03:18,900 --> 00:03:23,300 Simply your loop is going to stop. Actually, your loop has to repeat 65 00:03:23,600 --> 00:03:24,600 5 times. 66 00:03:25,200 --> 00:03:27,000 It has to iterate for 5 times. 67 00:03:27,000 --> 00:03:30,900 But because of 'break', in the first iteration itself 68 00:03:31,100 --> 00:03:35,000 your loop is going to stop. Whenever loop is going to stop 69 00:03:35,000 --> 00:03:36,700 even your, then at that time 70 00:03:36,700 --> 00:03:40,600 you're not going to execute any number of lines in your loop. 71 00:03:41,800 --> 00:03:45,900 So, because of this 'break' your flow of execution part will 72 00:03:45,900 --> 00:03:49,600 come out from loop. Then after Loop what you have? Simply 73 00:03:49,600 --> 00:03:51,000 you are printing something, "after loop", 74 00:03:51,000 --> 00:03:52,300 that's what you are executing. 75 00:03:53,800 --> 00:03:56,800 Otherwise, let me write a 'break' after 'print' statement. 76 00:03:56,800 --> 00:03:58,800 [no audio] 77 00:03:58,800 --> 00:04:03,800 Now see the result. We are getting 3. Why? Before 'break' you have 78 00:04:03,800 --> 00:04:04,800 'print(each)'. 79 00:04:04,800 --> 00:04:08,000 So at least for first value you are printing. After printing 80 00:04:08,000 --> 00:04:11,300 your first value or after executing your first iteration, 81 00:04:11,600 --> 00:04:15,400 you have immediately 'break'. Whenever you have a 'break', actually 82 00:04:15,500 --> 00:04:16,899 if you don't have break what will happen? 83 00:04:16,899 --> 00:04:19,700 Your Python will take this 4 value, and then it'll print, 84 00:04:19,700 --> 00:04:22,600 then it'll take 56, and it will print, it will take 7 and it 85 00:04:22,600 --> 00:04:25,800 will print, then it'll take 8, and it will print. That means 86 00:04:25,800 --> 00:04:28,800 it has to iterate for certain number of times. But because 87 00:04:28,800 --> 00:04:34,400 of 'break' your flow of control instead of going for next value 88 00:04:34,500 --> 00:04:37,000 it is coming out from your loop. That's it. 89 00:04:37,100 --> 00:04:38,700 That is the usage of 'break'. 90 00:04:40,200 --> 00:04:44,600 Suppose my intention is, first let me print all your values. 91 00:04:45,600 --> 00:04:49,400 You're getting, right. Whenever if I get 56 number, then I 92 00:04:49,400 --> 00:04:52,300 don't want to print remaining numbers. Whenever if I get a 93 00:04:52,300 --> 00:04:57,400 number called 56 while printing your values, after the number, 94 00:04:58,600 --> 00:05:01,200 after the number what you have? 7 and 8. Means it 95 00:05:01,200 --> 00:05:04,200 has to iterate for two more times, but I don't want to iterate 96 00:05:04,300 --> 00:05:08,100 whenever if my number is equals to, if my number is equals 97 00:05:08,100 --> 00:05:12,100 to 56 at that time, after that 98 00:05:12,300 --> 00:05:15,200 I don't want to execute my loop. Then simply use 'break'. Now, 99 00:05:15,200 --> 00:05:19,900 see the result. After getting 56 you are not getting 7 100 00:05:19,900 --> 00:05:22,800 and 8, because you are stopping your loop whenever if 101 00:05:22,800 --> 00:05:25,000 you get number as 56, that's it. 102 00:05:25,000 --> 00:05:27,900 [no audio] 103 00:05:27,900 --> 00:05:30,100 Right. Just assume that 104 00:05:31,400 --> 00:05:35,200 you're going to get some thousands of paths list, list of 105 00:05:35,200 --> 00:05:39,400 paths you have in your hand. Somewhere in some path, somewhere 106 00:05:39,400 --> 00:05:40,400 in some path 107 00:05:40,700 --> 00:05:42,000 you have your required path. 108 00:05:42,000 --> 00:05:45,500 Once if you are able to find your required path, then I don't 109 00:05:45,500 --> 00:05:50,500 want to execute the remaining iterations for my loop. 110 00:05:51,000 --> 00:05:54,700 Let me simply take in this way so that it will be very clear. 111 00:05:54,700 --> 00:05:57,800 [no audio] 112 00:05:57,800 --> 00:06:00,500 Just assume that I am writing a simple Python script to identify 113 00:06:00,500 --> 00:06:04,500 all the paths, and assume that I got all the paths in my host 114 00:06:05,800 --> 00:06:09,100 Right. Let me take suppose '/usr/bin'. 115 00:06:10,600 --> 00:06:12,500 then, '/usr/ 116 00:06:14,800 --> 00:06:16,700 bin/httpd’, 117 00:06:19,000 --> 00:06:21,600 something, some '/home 118 00:06:23,000 --> 00:06:28,800 /users/xyz/weblogic/config.xml', 119 00:06:28,800 --> 00:06:29,700 something like that. 120 00:06:31,300 --> 00:06:32,900 Right. Now, 121 00:06:32,900 --> 00:06:35,100 [no audio] 122 00:06:35,100 --> 00:06:39,100 I need to find out the path in which my 'httpd' is 123 00:06:39,100 --> 00:06:43,100 there. That is my intention. Then suppose, first of all to take 124 00:06:43,100 --> 00:06:46,700 one by one path, 'for each_path in paths', 125 00:06:47,400 --> 00:06:51,400 then I can print simply in this way, my 'each_path' I can print. 126 00:06:53,000 --> 00:06:59,200 But I want to print the path which consists of 'httpd'. 127 00:06:59,200 --> 00:07:01,300 [no audio] 128 00:07:01,300 --> 00:07:09,300 Right. See that 'if 'httpd' is there, 'httpd', if it is there 129 00:07:09,300 --> 00:07:10,300 in your path, 130 00:07:12,000 --> 00:07:13,000 then I am printing. 131 00:07:13,000 --> 00:07:15,500 [no audio] 132 00:07:15,500 --> 00:07:16,500 It's printing. 133 00:07:17,300 --> 00:07:19,300 But your loop is not stopping. 134 00:07:20,700 --> 00:07:24,200 It is taking somewhere second iteration and in the second iteration 135 00:07:24,300 --> 00:07:25,800 your condition is satisfied, 136 00:07:25,800 --> 00:07:29,300 then you are printing. Anyway, because this is for loop it 137 00:07:29,300 --> 00:07:32,400 is going to take next path and it is checking. Anyway, in 138 00:07:32,400 --> 00:07:33,900 this it is not there, 'httpd', 139 00:07:33,900 --> 00:07:35,300 that's why you're not getting any output. 140 00:07:35,600 --> 00:07:38,400 But still your Python is trying to take remaining iteration 141 00:07:38,400 --> 00:07:42,300 values, remaining values from your list, but my intention 142 00:07:42,300 --> 00:07:46,400 is once if I get my path, I mean the path which consists 143 00:07:46,400 --> 00:07:49,900 of 'httpd', then I don't want to iterate 144 00:07:51,100 --> 00:07:52,900 remaining, for remaining paths. 145 00:07:53,400 --> 00:07:55,600 I don't want to execute my loop for remaining paths. 146 00:07:55,600 --> 00:07:58,200 Simply I want to stop. Because I got my required path 147 00:07:58,500 --> 00:08:00,400 why should I iterate for remaining paths? 148 00:08:00,900 --> 00:08:03,000 Why should I waste unnecessarily my execution time? 149 00:08:04,000 --> 00:08:06,700 That's why what I am doing is, simply I am stopping. 150 00:08:09,200 --> 00:08:13,500 Right. See if I don't use 'break', just for your understanding 151 00:08:13,500 --> 00:08:15,400 I am writing, 'print( 152 00:08:16,700 --> 00:08:20,800 "Now working on", I'm printing 'each_path'. 153 00:08:22,200 --> 00:08:24,600 See the result. Working on first path. 154 00:08:24,600 --> 00:08:26,500 Anyway, in this 'httpd' is not there 155 00:08:26,500 --> 00:08:28,400 that's why you are not printing your path. 156 00:08:28,800 --> 00:08:31,700 Now working on '/usr/bin/httpd'. In this 'httpd' is there 157 00:08:31,700 --> 00:08:34,799 that's why you are printing that. So now you got your required 158 00:08:34,799 --> 00:08:37,000 path. Why should we go and take next path? 159 00:08:37,100 --> 00:08:39,700 I don't want to get, but your Python is taking no, because 160 00:08:39,700 --> 00:08:41,900 this is a loop it is going to take all the paths, 161 00:08:42,500 --> 00:08:44,400 I mean whatever the list of values you have. 162 00:08:45,700 --> 00:08:49,000 But now my requirement is, once if I get my required path 163 00:08:49,000 --> 00:08:51,400 then I want to stop forcefully my loop. 164 00:08:51,500 --> 00:08:54,500 Yes, you can stop it in this way. That's it. Now see that. 165 00:08:55,100 --> 00:08:59,400 Once if you print your 'each_path', then you are stopping, right. Now, 166 00:08:59,400 --> 00:09:01,800 let me write something outside of your loop. 167 00:09:03,200 --> 00:09:08,900 "outside of for loop". Now, you're getting "outside of for loop" 168 00:09:08,900 --> 00:09:12,200 line. After printing your 'httpd' immediately 169 00:09:12,300 --> 00:09:16,500 it is stopping because 'break' is there. Whenever 'break' is encountered 170 00:09:16,500 --> 00:09:20,600 simply your loop will stop, not only your for loop, even it 171 00:09:20,600 --> 00:09:23,300 will work even for your while loop as well. 172 00:09:23,600 --> 00:09:25,600 Let me take a simple example in while loop. 173 00:09:25,600 --> 00:09:28,100 [no audio] 174 00:09:28,100 --> 00:09:30,300 Suppose I am doing 175 00:09:30,300 --> 00:09:34,200 in this way, 'while True'. You know, this is an infinite Loop, 176 00:09:34,600 --> 00:09:38,456 right? So initially I am taking some count, 'cnt=1', 177 00:09:38,456 --> 00:09:42,700 and I am printing my 'cnt'. After 'cnt' 178 00:09:42,700 --> 00:09:45,400 I'm increasing my 'cnt', 'cnt=cnt+1'. 179 00:09:45,400 --> 00:09:48,200 [no audio] 180 00:09:48,200 --> 00:09:52,200 Yes, you're going to get infinite numbers, but my intention 181 00:09:52,200 --> 00:09:58,700 is in case if I get, if I print number I mean up to 100, once 182 00:09:58,700 --> 00:10:02,200 I reach 100, then I want to stop my while loop. Then 183 00:10:02,200 --> 00:10:06,300 what I am doing is 'if cnt == 100' stop your 184 00:10:06,300 --> 00:10:08,200 while. That's it. 'break'. 185 00:10:09,000 --> 00:10:10,000 See that 186 00:10:11,000 --> 00:10:14,300 once 100 is reached you are going to stop forcefully 187 00:10:14,300 --> 00:10:17,300 your loop. Stopping loop is nothing but stopping 188 00:10:17,300 --> 00:10:18,600 the next iterations. 189 00:10:20,100 --> 00:10:23,000 You are stopping. Instead of going for next 190 00:10:23,000 --> 00:10:25,200 iteration simply you are stopping your loop. That's it. 191 00:10:26,000 --> 00:10:28,400 So that is the use case of your simply, 192 00:10:28,700 --> 00:10:32,700 I mean about the 'break'. Now, let me go with 'continue'. 193 00:10:31,700 --> 00:10:34,900 [no audio] 194 00:10:34,900 --> 00:10:39,300 So try to understand 'continue'. It is somewhat confusing, but 195 00:10:39,900 --> 00:10:40,800 you need to understand it. 196 00:10:40,800 --> 00:10:43,800 Anyway, while going forward we'll use this 'continue' and 'break' 197 00:10:43,800 --> 00:10:45,800 in different scenarios so that you will be good. 198 00:10:46,100 --> 00:10:49,000 But at least for time being just try to understand what is 199 00:10:49,000 --> 00:10:54,500 the logic behind your 'continue'. See suppose 200 00:10:54,500 --> 00:10:55,500 what I am doing is, 201 00:10:55,500 --> 00:10:58,400 [no audio] 202 00:10:58,400 --> 00:10:59,400 let me take 203 00:10:59,400 --> 00:11:01,300 [no audio] 204 00:11:01,300 --> 00:11:03,000 a range of 10 numbers, 205 00:11:04,600 --> 00:11:07,100 then I am printing all the numbers, 206 00:11:08,100 --> 00:11:12,800 first of all. Yes, you are getting from 1 to 9, right, 0 to 9, 207 00:11:12,800 --> 00:11:14,400 but I want to get suppose 1 to 10. 208 00:11:14,500 --> 00:11:16,500 But no problem, you can take anything. 209 00:11:17,000 --> 00:11:20,200 Let me take 1 to 11 so that you are going to get suppose 1 to 10. 210 00:11:20,200 --> 00:11:22,600 [no audio] 211 00:11:22,600 --> 00:11:30,800 Now, I want to print the numbers 1 to 10 except 7 number, 212 00:11:32,000 --> 00:11:34,800 then I can write in this way 213 00:11:34,800 --> 00:11:38,800 first of all. If number is, whatever the number, if that is 214 00:11:38,800 --> 00:11:41,600 not equal to 7, then I am printing. That's fine. 215 00:11:41,600 --> 00:11:43,500 [no audio] 216 00:11:43,500 --> 00:11:46,400 This is one way to write your logic. 217 00:11:46,400 --> 00:11:48,500 [no audio] 218 00:11:48,500 --> 00:11:50,800 Right. Now, you are not getting your number 7, right? 219 00:11:52,100 --> 00:11:55,000 One more way is, first of all simply I'm writing 220 00:11:55,000 --> 00:11:57,100 'print("printing your number")'. 221 00:11:57,100 --> 00:12:00,700 [no audio] 222 00:12:00,700 --> 00:12:02,600 Then, guys be clear, 223 00:12:02,600 --> 00:12:04,500 [no audio] 224 00:12:04,500 --> 00:12:10,700 I am going to write your 'print(each)' outside of your 'if' condition 225 00:12:11,600 --> 00:12:12,600 see that. 226 00:12:13,800 --> 00:12:15,800 "printing your number". "printing your number". 227 00:12:15,800 --> 00:12:17,500 [no audio] 228 00:12:17,500 --> 00:12:18,500 Right. 229 00:12:18,900 --> 00:12:21,600 First of all, your 'print' statement is outside of your 230 00:12:21,600 --> 00:12:25,200 'if' condition. Now, instead of this line simply 231 00:12:25,200 --> 00:12:26,300 I'm writing 'continue'. 232 00:12:26,300 --> 00:12:28,800 [no audio] 233 00:12:28,800 --> 00:12:30,400 If number = 7, 234 00:12:32,100 --> 00:12:34,700 I'm writing simply 'continue'. Now see the result. 235 00:12:34,900 --> 00:12:36,500 We are not getting 7 no. Of course, 236 00:12:36,500 --> 00:12:38,200 your previous logic is perfectly correct. 237 00:12:38,200 --> 00:12:41,100 If number is, I mean, if each != 7 then only print 238 00:12:41,100 --> 00:12:43,300 it. That is correct. 239 00:12:43,700 --> 00:12:46,800 But at the same time, you can also write your logic in this 240 00:12:46,800 --> 00:12:52,600 way. What will happen if you write 'continue' keyword. See whenever 241 00:12:52,600 --> 00:12:58,100 'continue' is executing by your Python, then in that iteration 242 00:12:58,100 --> 00:13:00,700 the remaining logic whatever you have 243 00:13:01,400 --> 00:13:03,700 in your block that is going to simply skip. 244 00:13:03,700 --> 00:13:06,100 [no audio] 245 00:13:06,100 --> 00:13:08,600 Not only this line, even if you have some hundred lines 246 00:13:08,600 --> 00:13:12,000 here, after 'continue', see here also, here itself 247 00:13:12,000 --> 00:13:14,100 I have a 'continue', after 'continue' suppose 248 00:13:14,900 --> 00:13:20,700 "this is the line inside of your if condition 249 00:13:23,100 --> 00:13:24,800 after continue keyword". 250 00:13:24,800 --> 00:13:27,700 [no audio] 251 00:13:27,742 --> 00:13:30,100 See the result. Nowhere you are not, nowhere 252 00:13:30,100 --> 00:13:31,000 you are getting that line. 253 00:13:31,700 --> 00:13:32,700 The reason is, 254 00:13:34,400 --> 00:13:35,600 let me take this, 255 00:13:36,900 --> 00:13:42,100 see after 'continue', in your for loop block even if you 256 00:13:42,100 --> 00:13:46,000 have some thousands of lines all are going to skip. Now your 257 00:13:46,000 --> 00:13:48,400 Python will go for next iteration. 258 00:13:49,600 --> 00:13:52,700 Actually, it is going to repeat for 10 times, right. 259 00:13:53,734 --> 00:13:56,900 (1,11) means 10 numbers you are going to get. Once your 260 00:13:56,900 --> 00:14:00,300 number = 7, if it is != 7, you are not 261 00:14:00,300 --> 00:14:05,000 executing 'continue', then simply you're printing. But if it is = 7 262 00:14:05,067 --> 00:14:07,600 what will happen? 'continue' is executing. Whenever 263 00:14:07,600 --> 00:14:10,700 'continue' is executing the remaining lines which you have in 264 00:14:10,700 --> 00:14:14,000 your block, they are going to simply mask. 265 00:14:14,100 --> 00:14:15,300 They're going to skip. That's it. 266 00:14:16,600 --> 00:14:17,600 For time being guys 267 00:14:17,600 --> 00:14:21,100 don't worry much about your 'continue' keyword, simply assume 268 00:14:21,100 --> 00:14:24,900 that whenever 'continue' line is executing by your Python, 269 00:14:25,200 --> 00:14:29,100 then the remaining lines which are there after 'continue' keyword, 270 00:14:29,100 --> 00:14:30,100 they are going to skip. 271 00:14:31,500 --> 00:14:33,200 So while writing some real-time scripts 272 00:14:33,200 --> 00:14:35,400 you will get multiple situations, there 273 00:14:35,600 --> 00:14:39,500 you will understand that why we need this 'continue' keyword. 274 00:14:39,500 --> 00:14:40,800 Up to that you have to wait. 275 00:14:41,500 --> 00:14:43,600 For time being just assume that 'continue' is going to skip the 276 00:14:43,600 --> 00:14:45,100 remaining lines in that iteration. 277 00:14:45,100 --> 00:14:46,900 [no audio] 278 00:14:46,900 --> 00:14:52,500 Right. Okay. These two are your loop control statements, 279 00:14:52,500 --> 00:14:55,100 I mean 'break' and 'continue'. Apart from that 280 00:14:55,100 --> 00:14:58,600 you are also having simply 'pass' keyword, or 'pass' statement. 281 00:14:58,900 --> 00:14:59,900 What is this? 282 00:15:00,600 --> 00:15:02,100 See not only for your loops, 283 00:15:02,100 --> 00:15:07,700 it is also helpful for your functions, classes, and then 'if' condition. 284 00:15:08,700 --> 00:15:12,700 First let me write something called 'if True' then 285 00:15:12,700 --> 00:15:15,200 'print("ok")'. Now see the result. 286 00:15:16,000 --> 00:15:17,100 This is fine, right? 287 00:15:17,300 --> 00:15:22,100 But what I'm doing is, I am removing this line. 'if True:' I am writing. 288 00:15:22,400 --> 00:15:23,400 Now you're getting an error. 289 00:15:23,700 --> 00:15:28,700 The reason is, we know that whenever you have a 'if' 290 00:15:28,700 --> 00:15:32,100 condition you should have some block inside of that, right, 291 00:15:32,400 --> 00:15:35,800 at least one line, but for time being I don't want to write 292 00:15:35,800 --> 00:15:38,600 anything. Of course, I don't know what I have to write 293 00:15:38,600 --> 00:15:42,100 as of now. But I don't want to get an error, then simply write 294 00:15:42,100 --> 00:15:45,800 'pass'. It won't do anything. Simply it will avoid, 295 00:15:46,900 --> 00:15:51,500 or it will, simply it will make one block but it won't do anything. 296 00:15:51,500 --> 00:15:53,800 That's it. The same way 297 00:15:53,800 --> 00:15:56,200 [no audio] 298 00:15:56,200 --> 00:16:00,400 let me take some simply loop, 'for each in', simply range of 299 00:16:00,400 --> 00:16:02,900 anything you can take, right. Now. 300 00:16:02,900 --> 00:16:03,900 I'm running. Again 301 00:16:03,900 --> 00:16:07,800 you are getting an error because for loop, right, loop means 302 00:16:07,800 --> 00:16:11,300 it has to iterate certain number of times, certain number 303 00:16:11,300 --> 00:16:15,600 of times some code, or block, or some set of statements, 304 00:16:15,600 --> 00:16:16,600 but we don't have anything 305 00:16:16,600 --> 00:16:18,500 no. That's why it is giving an error. 306 00:16:19,200 --> 00:16:22,000 So as of now, I don't know what I have to write but I need 307 00:16:22,000 --> 00:16:24,700 a loop here. Just to avoid an error you can 308 00:16:24,700 --> 00:16:27,200 use your 'pass' keyword. That's it. 309 00:16:27,200 --> 00:16:29,100 [no audio] 310 00:16:29,100 --> 00:16:34,000 Right. Okay guys, thank you for watching this video. This mainly 311 00:16:34,000 --> 00:16:35,300 guys, mainly you need to understand about 312 00:16:35,300 --> 00:16:37,200 'break' and 'continue', right? 313 00:16:37,200 --> 00:16:41,100 Anyway, 'break' is clear, but maybe some people will have confusion 314 00:16:41,100 --> 00:16:46,100 on 'continue'. But you will get clarified while going forward. Right. 315 00:16:47,700 --> 00:16:48,700 Okay, Bye. 316 00:16:48,700 --> 00:16:50,226 [no audio]