1 00:00:00,300 --> 00:00:03,230 In this video, we are really talking about the loops. 2 00:00:03,240 --> 00:00:09,780 So loops are so much important that I want to put in one 200 numbers. 3 00:00:11,180 --> 00:00:13,780 So I can go ahead and do. 4 00:00:15,860 --> 00:00:21,560 And if you go and run this and we can see like this, we want to do 400 number. 5 00:00:21,620 --> 00:00:23,390 So it's practically impossible. 6 00:00:24,570 --> 00:00:32,220 So what we can do is we can use the loops we were discussing about the for loop if loop and wide loop. 7 00:00:33,420 --> 00:00:38,070 So these are the main important loops will be using. 8 00:00:38,520 --> 00:00:41,250 So first, let's discuss about that for a loop. 9 00:00:43,420 --> 00:00:47,170 So the first takes the syntax like this. 10 00:00:47,830 --> 00:00:52,030 In this we need to do three statements. 11 00:00:52,690 --> 00:00:58,690 That is the starting condition so I can declare a variable into I is equals zero. 12 00:00:58,990 --> 00:01:04,600 Generally I use it for looping the variables i.e. stands for retrieval. 13 00:01:04,600 --> 00:01:07,060 So it's, it's kind of like that. 14 00:01:07,450 --> 00:01:10,930 So I and these are the common for the loop variables. 15 00:01:12,430 --> 00:01:15,790 Now this is the starting statement. 16 00:01:15,940 --> 00:01:22,960 No, I can just see my current and I need to see at which point my loop shouldn't. 17 00:01:22,990 --> 00:01:29,800 So we want to put in a hundred numbers so I can say I less than is equal to 100. 18 00:01:30,790 --> 00:01:35,500 And then what you want to do for each step, we need to increment this one. 19 00:01:35,740 --> 00:01:38,590 So increment is adding the value by one. 20 00:01:38,740 --> 00:01:40,030 So I can just say I. 21 00:01:42,710 --> 00:01:51,370 I pressed press, and now this rule continues until the high value becomes one. 22 00:01:53,180 --> 00:01:56,640 Now, if I go and print this, let's say hi. 23 00:01:57,590 --> 00:02:04,450 So the first when the first loop is executed, the ivory will be initialized. 24 00:02:04,460 --> 00:02:09,950 And this statement only executes for the first time for this. 25 00:02:09,950 --> 00:02:10,180 For. 26 00:02:11,720 --> 00:02:14,360 So entire value is zero. 27 00:02:14,390 --> 00:02:18,110 And then it takes the condition whether it is done or not. 28 00:02:18,920 --> 00:02:26,000 And since you're doing this, then hundred, it's going to execute this code inside these braces and 29 00:02:26,000 --> 00:02:27,530 executes this one. 30 00:02:27,530 --> 00:02:36,380 I press first then of this quarter now I value becomes one and again this will be checked against this 31 00:02:36,380 --> 00:02:36,840 condition. 32 00:02:37,000 --> 00:02:42,490 This one is done is standard screw and again, execute this one and grow in this one. 33 00:02:42,500 --> 00:02:48,410 So this process continues until the I great then that is one not one so it's going to run this. 34 00:02:48,860 --> 00:02:53,580 And here you can see there are obviously hundred highs. 35 00:02:55,040 --> 00:03:02,390 Now instead of printing just two, I can use this I to print onto the screen so I can run this. 36 00:03:03,770 --> 00:03:06,710 And here we can see from zero to under. 37 00:03:11,470 --> 00:03:20,260 So this is how you lose the fat group and we can do the same with the value way of the condition. 38 00:03:21,250 --> 00:03:30,040 So this white loop is very similar to understand, very easy to understand why this expression becomes 39 00:03:30,040 --> 00:03:30,470 fast. 40 00:03:30,490 --> 00:03:32,370 Until then, go on and it's good. 41 00:03:32,380 --> 00:03:32,830 This one. 42 00:03:33,610 --> 00:03:34,420 So let's go. 43 00:03:34,420 --> 00:03:35,900 And let's do. 44 00:03:37,920 --> 00:03:40,860 We need to be clear like this in the U.S. and Europe. 45 00:03:43,140 --> 00:03:44,760 This takes only one expression. 46 00:03:48,240 --> 00:03:50,170 To get less than 100. 47 00:03:53,700 --> 00:03:54,260 Brendan, you. 48 00:03:57,270 --> 00:03:59,190 So I'm going to comment this one. 49 00:04:01,780 --> 00:04:08,020 So what we are doing is first we have the days go to zero and this white loop is taking, uh, Mother 50 00:04:08,020 --> 00:04:09,130 Davis then handed. 51 00:04:09,130 --> 00:04:12,310 And if that is true, we are executing this fun. 52 00:04:12,700 --> 00:04:18,280 Now, if I go and run this and here you can see the program in fine and we execute this, right? 53 00:04:18,640 --> 00:04:25,990 Because there is no stopping condition, because the value is not changing in this room and we are taking 54 00:04:25,990 --> 00:04:29,380 the same condition over and over and good in the same code. 55 00:04:29,770 --> 00:04:34,960 So that's why the improvement should be done after the code plus press. 56 00:04:36,880 --> 00:04:47,020 Now if I to run this and here we can see zero 200 I think it's 99 because there is still no run this 57 00:04:47,410 --> 00:04:49,000 we get the hundred numbers. 58 00:04:50,620 --> 00:04:56,560 So care should be taken to add the growing value at the end of this course. 59 00:04:56,620 --> 00:05:00,360 Otherwise you're gonna do this infinitum. 60 00:05:01,960 --> 00:05:03,400 So this is the way loop. 61 00:05:06,150 --> 00:05:07,420 And the next one is the flu. 62 00:05:07,440 --> 00:05:10,910 So if flu bees are used for condition taking. 63 00:05:12,090 --> 00:05:18,150 So if you want to take the value that is greater than or equal or less, then you are rejiggered some 64 00:05:18,300 --> 00:05:22,680 instructions or otherwise, you know, take good value added instructions. 65 00:05:27,530 --> 00:05:29,990 Sort of two ideas equals two. 66 00:05:33,880 --> 00:05:36,730 Order to convert the to 32 off. 67 00:05:40,230 --> 00:05:43,830 So let's just take the user and put the. 68 00:05:45,420 --> 00:05:46,830 And there you are, the. 69 00:05:52,110 --> 00:05:56,040 So what we're going to do is we're going to print something up. 70 00:05:57,270 --> 00:05:59,700 You've done the indexes. 71 00:05:59,700 --> 00:06:02,760 You've got the brackets in this. 72 00:06:02,760 --> 00:06:04,410 We need to put the expression. 73 00:06:06,790 --> 00:06:08,640 You've already used courses, Gertrude. 74 00:06:08,680 --> 00:06:09,180 Zero. 75 00:06:09,310 --> 00:06:13,630 Then that means we can say we can print to the. 76 00:06:15,870 --> 00:06:16,320 Is clean. 77 00:06:20,680 --> 00:06:21,710 You are group. 78 00:06:24,910 --> 00:06:31,360 So now if you if I go and run this one task for my tour. 79 00:06:33,790 --> 00:06:35,260 So it does not print anything. 80 00:06:35,710 --> 00:06:36,660 So it's gotten good. 81 00:06:36,670 --> 00:06:37,960 The input at zero. 82 00:06:38,290 --> 00:06:39,670 Now it prints something. 83 00:06:39,670 --> 00:06:40,090 You are. 84 00:06:43,390 --> 00:06:47,380 And if you want a good record, you can use it. 85 00:06:47,920 --> 00:06:54,010 So remember that it cannot exist without a single. 86 00:06:54,040 --> 00:06:58,340 If so, there should be at least a singing of you when there is a. 87 00:07:00,730 --> 00:07:08,710 So yeah, this is like, uh, not I agony not not of this expression. 88 00:07:08,980 --> 00:07:13,750 So if I didn't execute this, otherwise execute this one. 89 00:07:14,380 --> 00:07:19,230 So for whatever the value of other than zero, this could get to execute. 90 00:07:20,080 --> 00:07:21,690 We can say you are not to. 91 00:07:23,870 --> 00:07:28,630 So it's going you are 23 and you can see we got out, but you are not. 92 00:07:30,080 --> 00:07:31,910 And it's go, go. 93 00:07:31,910 --> 00:07:32,780 And you know you are. 94 00:07:34,010 --> 00:07:36,670 And we have something called the loops. 95 00:07:36,930 --> 00:07:38,150 So if this. 96 00:07:42,120 --> 00:07:48,780 You can have a look inside group so here we can see we have it is equal to zero and then. 97 00:07:51,070 --> 00:07:53,110 Then we can relate some cold. 98 00:07:57,020 --> 00:07:57,220 Ah. 99 00:07:57,240 --> 00:07:59,230 Pejic Something you've, uh. 100 00:07:59,750 --> 00:08:00,960 Let's, uh, let's. 101 00:08:05,070 --> 00:08:06,210 Enter your name. 102 00:08:20,690 --> 00:08:24,680 And now here we are asking the user to enter the name. 103 00:08:25,250 --> 00:08:29,930 So if I can create another condition here, you name. 104 00:08:31,890 --> 00:08:33,420 Name equals. 105 00:08:37,980 --> 00:08:39,450 A chorus of group. 106 00:08:49,140 --> 00:08:50,400 Then I'm going to print that. 107 00:08:50,400 --> 00:08:51,270 You are? 108 00:08:53,850 --> 00:08:55,620 So I can comment on this one. 109 00:08:59,190 --> 00:09:03,300 So let's go and run this one eye integrity gyro. 110 00:09:03,780 --> 00:09:06,370 And now we can see this loop has been entered. 111 00:09:06,400 --> 00:09:08,850 Now it's asking for the user input name. 112 00:09:09,270 --> 00:09:10,740 Now let's root. 113 00:09:10,920 --> 00:09:12,780 And here you can see we are done. 114 00:09:13,080 --> 00:09:13,440 You are. 115 00:09:16,220 --> 00:09:17,660 We can also put URLs. 116 00:09:24,990 --> 00:09:27,930 You are in a men's and women's group. 117 00:09:31,240 --> 00:09:40,680 So zero and I consider taxes now I will get the output as you are an admin screw you are an admin. 118 00:09:40,690 --> 00:09:40,930 So. 119 00:09:42,240 --> 00:09:46,220 So you can use these conditions. 120 00:09:46,230 --> 00:09:54,420 If you just practice for a little time, you can easily understand this, uh, multi-level condition 121 00:09:54,420 --> 00:09:54,810 taking. 122 00:10:03,320 --> 00:10:09,040 You can also check whether the where you are is not empty or not. 123 00:10:09,050 --> 00:10:11,690 You can check like this if off it. 124 00:10:11,930 --> 00:10:17,510 So basically, if it's not zero, it will take the as if true. 125 00:10:19,610 --> 00:10:22,550 Otherwise it's going to take it as false. 126 00:10:22,760 --> 00:10:23,090 So. 127 00:10:24,640 --> 00:10:32,560 So this can also be used for taking the variable easier and saying or are not. 128 00:10:34,400 --> 00:10:40,550 So the tougher these groups these are, the major groups will be normally using in our day.