1 00:00:00,360 --> 00:00:06,330 Right now, another thing here actually used not just in the loop, actually in the loop while loop 2 00:00:06,330 --> 00:00:07,610 for loop, OK? 3 00:00:08,800 --> 00:00:13,000 The condition, something called continuo or break or Besse. 4 00:00:13,150 --> 00:00:14,980 OK, so let's have an example. 5 00:00:15,100 --> 00:00:18,250 I equate zero I is less than 10 this time. 6 00:00:18,760 --> 00:00:24,820 No, I will keep updating our I will keep everything that I value. 7 00:00:25,550 --> 00:00:29,530 OK, but here I would have a condition inside the while loop. 8 00:00:29,530 --> 00:00:32,610 As you can see, we are in the side the way loop. 9 00:00:32,980 --> 00:00:38,530 So if I equal equal five then I will. 10 00:00:40,180 --> 00:00:40,570 Three. 11 00:00:41,730 --> 00:00:46,320 OK, now photo me just in this examine and see what will happen. 12 00:00:46,890 --> 00:00:47,310 So. 13 00:00:48,260 --> 00:00:53,870 This should print only from zero to five because we already printed before. 14 00:00:54,170 --> 00:01:00,620 OK, before this condition, I mean, now the break here, actually the statement will break from that 15 00:01:00,710 --> 00:01:06,650 current loop or the current loop, which is there when we have it as a way loop. 16 00:01:06,710 --> 00:01:08,400 OK, now let's have a look here. 17 00:01:08,420 --> 00:01:10,080 Let's clear the screen first. 18 00:01:10,490 --> 00:01:12,730 Now you can see that it is infinite loop. 19 00:01:12,950 --> 00:01:13,790 Did you guessed why? 20 00:01:14,090 --> 00:01:16,890 Yeah, because we forgot to add here. 21 00:01:17,360 --> 00:01:17,750 Yeah. 22 00:01:17,990 --> 00:01:20,370 Actually, we forgot what I mean. 23 00:01:20,560 --> 00:01:21,020 That's one. 24 00:01:22,620 --> 00:01:23,070 All right. 25 00:01:24,250 --> 00:01:28,300 No, actually, it's good that we saw that in practice, what is infinite loops? 26 00:01:30,140 --> 00:01:35,720 Now, let's clear the screen and let's so you can see that we are printing from zero to four. 27 00:01:36,260 --> 00:01:36,980 OK, now. 28 00:01:38,020 --> 00:01:45,400 As you can see, when we increased, when it went when it became for point four, four plus one, which 29 00:01:45,400 --> 00:01:50,310 means five now if it is five, equal equal five, yes, then break. 30 00:01:50,440 --> 00:01:53,230 So it will bring it from zero to four. 31 00:01:54,130 --> 00:01:57,520 And which means that we bring it five times. 32 00:01:57,700 --> 00:02:01,950 OK, now let's have another example for continual statement. 33 00:02:02,620 --> 00:02:04,240 No, it is continue. 34 00:02:04,570 --> 00:02:06,890 Now let's have another Syntex now. 35 00:02:06,910 --> 00:02:10,960 This time the sprint, these after the if condition, OK? 36 00:02:12,300 --> 00:02:22,280 So I will have it here, but again, it is inside that that while indentation, so let's print I and 37 00:02:22,280 --> 00:02:26,300 let's increase the value equal I plus one. 38 00:02:26,850 --> 00:02:27,230 Right. 39 00:02:27,660 --> 00:02:33,300 OK, so if the value is five this time, I will continue. 40 00:02:33,600 --> 00:02:34,060 OK. 41 00:02:34,440 --> 00:02:36,770 OK, now you may ask me what is the continuum. 42 00:02:37,040 --> 00:02:37,770 Now we don't. 43 00:02:37,800 --> 00:02:40,910 What is break break break from the current loop. 44 00:02:41,120 --> 00:02:42,340 OK now continue. 45 00:02:43,170 --> 00:02:46,320 Which means that continue immediately to the loop. 46 00:02:46,600 --> 00:02:47,060 Right. 47 00:02:47,610 --> 00:02:49,780 So this will give us an infinite loop. 48 00:02:49,800 --> 00:02:50,990 Why is that now. 49 00:02:51,060 --> 00:02:52,930 For me I equals zero. 50 00:02:53,220 --> 00:02:57,810 It will keep keep until it is reached for so for less than ten. 51 00:02:57,840 --> 00:03:00,420 Yes it is for equal equal five. 52 00:03:00,430 --> 00:03:00,760 No. 53 00:03:00,780 --> 00:03:06,040 So I will not do this condition and I would go print for now for this one which is five. 54 00:03:06,210 --> 00:03:07,470 So the new value is five. 55 00:03:07,740 --> 00:03:09,120 Five less than ten years. 56 00:03:09,120 --> 00:03:10,340 Five equal five. 57 00:03:10,350 --> 00:03:10,680 Yes. 58 00:03:10,680 --> 00:03:11,250 Continue. 59 00:03:11,460 --> 00:03:12,510 So I would go again. 60 00:03:12,510 --> 00:03:12,840 Five. 61 00:03:12,840 --> 00:03:13,500 Less than ten. 62 00:03:13,530 --> 00:03:13,950 Yes. 63 00:03:14,250 --> 00:03:15,060 Is five equal. 64 00:03:15,060 --> 00:03:15,720 Equal five. 65 00:03:15,750 --> 00:03:16,050 Yes. 66 00:03:16,050 --> 00:03:16,380 Continue. 67 00:03:16,410 --> 00:03:18,580 So this will give us an infinite loop. 68 00:03:18,630 --> 00:03:24,330 OK, so it's this this out actually better to have it relection. 69 00:03:24,540 --> 00:03:29,460 So yeah, you can see that we have an infinite loop but without printing anything, as you can see the 70 00:03:29,460 --> 00:03:31,070 cursor is stopped moving. 71 00:03:31,770 --> 00:03:35,900 So which means that this is an infinite loop and actually this is back. 72 00:03:35,910 --> 00:03:45,010 So to avoid that we would add the AI equals AI plus one here and we can remove this or you can put it 73 00:03:45,060 --> 00:03:45,380 out. 74 00:03:45,390 --> 00:03:45,930 It's OK. 75 00:03:46,860 --> 00:03:47,540 Nobody. 76 00:03:49,110 --> 00:03:50,640 So now let's have a look. 77 00:03:53,200 --> 00:03:59,260 Yeah, you can see that this time, one, two, three, four, and you can see or you can notice that 78 00:03:59,260 --> 00:04:00,070 five is not here. 79 00:04:00,340 --> 00:04:01,240 Now, what is that? 80 00:04:01,480 --> 00:04:09,130 Let's have another look now when we reach for four, is this done 10 years for this one right now? 81 00:04:09,130 --> 00:04:10,830 If it is five, let's continue. 82 00:04:11,050 --> 00:04:12,340 So it is continuous. 83 00:04:12,340 --> 00:04:13,390 It will return again. 84 00:04:13,660 --> 00:04:14,360 So five. 85 00:04:14,410 --> 00:04:15,190 Less than ten. 86 00:04:15,200 --> 00:04:16,780 Yes, but it will increase. 87 00:04:17,110 --> 00:04:20,210 So we didn't print for five at all. 88 00:04:20,590 --> 00:04:21,420 So six. 89 00:04:21,420 --> 00:04:21,790 Yes. 90 00:04:21,820 --> 00:04:23,290 Is I equal. 91 00:04:23,290 --> 00:04:23,920 Equal six. 92 00:04:24,310 --> 00:04:24,780 No. 93 00:04:24,790 --> 00:04:29,250 So I would bring six over over until I reach ten actually or nine. 94 00:04:29,920 --> 00:04:31,080 And what you may ask me. 95 00:04:31,090 --> 00:04:32,170 But why it is ten. 96 00:04:32,560 --> 00:04:34,230 Because if you have not this year. 97 00:04:34,360 --> 00:04:37,210 So when we reach nine nine instantaneous. 98 00:04:37,420 --> 00:04:43,960 I added here as you can see I didn't get from I added nine plus one which is ten and I printed out. 99 00:04:44,290 --> 00:04:46,640 OK, so that's why it is then this time. 100 00:04:47,140 --> 00:04:52,090 OK, now finally we have another thing which this time called this. 101 00:04:52,510 --> 00:04:56,020 Now this means that don't do anything, just bas this. 102 00:04:56,860 --> 00:04:58,720 Now what is that exactly. 103 00:04:58,720 --> 00:05:00,160 And why it is used now. 104 00:05:00,160 --> 00:05:06,820 Sometimes you wrote functions or your specific indentation and you don't need to do anything currently 105 00:05:06,820 --> 00:05:10,650 or you don't need to do anything just to check if it is something or not. 106 00:05:10,690 --> 00:05:14,800 OK, and you don't need to include anything, you just need it to be empty. 107 00:05:14,950 --> 00:05:19,630 But you know that empty is not acceptable with with Python. 108 00:05:19,750 --> 00:05:25,090 So if I removed this and what if I equally equal five without anything inside it? 109 00:05:25,570 --> 00:05:26,950 So it it's just it's out of this. 110 00:05:26,960 --> 00:05:27,880 I actually it's better. 111 00:05:28,760 --> 00:05:35,450 And if I run this, you can see that expected and indented block, which means that we need to put something 112 00:05:35,450 --> 00:05:35,640 here. 113 00:05:35,900 --> 00:05:36,900 So how to do that? 114 00:05:36,920 --> 00:05:43,100 Actually, we will use the best, which means that in this indentation or this block, there are nothing 115 00:05:43,250 --> 00:05:45,240 but actually not nothing. 116 00:05:45,260 --> 00:05:46,110 It is best. 117 00:05:46,340 --> 00:05:47,460 So just does that. 118 00:05:47,720 --> 00:05:49,180 So let's have a look here. 119 00:05:49,190 --> 00:05:49,910 Let's run this. 120 00:05:50,200 --> 00:05:51,100 Let's see what will happen. 121 00:05:51,260 --> 00:05:52,450 Let's clear the screen first. 122 00:05:52,880 --> 00:05:53,180 Yeah. 123 00:05:53,180 --> 00:05:59,170 You can see this time we printed everything, but this time five is included because we didn't continue 124 00:05:59,810 --> 00:06:00,860 when it is five. 125 00:06:00,860 --> 00:06:02,640 So we already print that. 126 00:06:02,640 --> 00:06:06,110 So which means that when we reached five, we did nothing. 127 00:06:06,290 --> 00:06:07,900 OK, and we Brantford. 128 00:06:08,060 --> 00:06:09,140 OK, that's it. 129 00:06:09,410 --> 00:06:09,740 All right. 130 00:06:09,750 --> 00:06:10,520 Thanks for watching.