1 00:00:12,900 --> 00:00:16,140 Hello and welcome to goal and programming language course. 2 00:00:16,590 --> 00:00:22,240 In the previous session, we talked about for Loop at Infinite Loop and Indecision. 3 00:00:22,260 --> 00:00:25,920 We want to talk about the other loops and control statements. 4 00:00:29,730 --> 00:00:39,450 For Luke as vile Luke A for Luke can ask the world as a vine Luke, this loop is executed until the 5 00:00:39,450 --> 00:00:40,950 given condition is true. 6 00:00:41,490 --> 00:00:45,420 When the value of the given condition is false, the loop ends. 7 00:00:47,010 --> 00:00:49,320 Now you can see the scene techs. 8 00:00:51,840 --> 00:00:57,210 Let's go to this school program to illustrate how to use Follow-Up as a white loop. 9 00:00:58,050 --> 00:01:05,730 First, define a variable as loop initialization, for example, define a variable like PI column equals 10 00:01:05,730 --> 00:01:08,430 and initialize it by one. 11 00:01:10,170 --> 00:01:13,080 Now define loop at sit and condition. 12 00:01:13,080 --> 00:01:13,290 Four. 13 00:01:13,290 --> 00:01:23,490 Terminate it, for example, for set condition I less than five open and close curly braces and write 14 00:01:23,490 --> 00:01:24,690 the statements here. 15 00:01:25,560 --> 00:01:29,520 For example, in this case, we want to print I variable value. 16 00:01:29,700 --> 00:01:35,970 So we write FP I and go to the next line. 17 00:01:36,180 --> 00:01:39,870 Now we must always increment the iterator here. 18 00:01:39,870 --> 00:01:51,270 It's already a bit, so we write I + + OK, reformat the code, save the project and execute the program. 19 00:01:51,360 --> 00:01:56,500 Now go to terminal run the program by the comment Go round dot back. 20 00:01:56,640 --> 00:02:04,380 This mean that go now we can see the output one two three four. 21 00:02:05,280 --> 00:02:12,810 In this example, we defined the variable named I and initialize it with the value of one. 22 00:02:13,440 --> 00:02:21,600 And then as long as I is less than five, one unit is added to the variable I each time and we were 23 00:02:21,600 --> 00:02:24,510 able to use the for loop as a vine loop. 24 00:02:24,960 --> 00:02:28,960 Also, the code block can be as many lines as you want. 25 00:02:28,990 --> 00:02:33,240 In this example, it's just one line of code that gets repeated. 26 00:02:33,840 --> 00:02:34,280 OK. 27 00:02:34,410 --> 00:02:40,470 In order not to prolong the time of decision, we will finish it and we will continue the content in 28 00:02:40,470 --> 00:02:41,520 the next session. 29 00:02:41,700 --> 00:02:42,180 Goodbye.