Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,360 --> 00:00:01,780
What is going on, guys?
2
00:00:01,820 --> 00:00:05,530
And in this section, we are talking about loops.
3
00:00:05,730 --> 00:00:12,570
So loops, loops is considered to be a very powerful tool that we will use a lot in these Kooris and
4
00:00:12,570 --> 00:00:14,460
in some of our future courses.
5
00:00:14,610 --> 00:00:22,170
And basically only is simply allowing us to loop or to run over and over again some piece of code to
6
00:00:22,170 --> 00:00:25,320
repeat some block of commands multiple times.
7
00:00:25,470 --> 00:00:28,740
And that's not exactly what we've used so far.
8
00:00:28,800 --> 00:00:29,130
Right.
9
00:00:29,160 --> 00:00:34,080
That's not something that we've used in the previous videos or in the previous sections.
10
00:00:34,200 --> 00:00:40,410
So we can say that up to this section, if we had some written commands, whether they were input output,
11
00:00:40,410 --> 00:00:47,100
math operations or whatsoever, we knew that these commands will be executed just once.
12
00:00:47,250 --> 00:00:50,700
They will simply be executed one after the other.
13
00:00:50,820 --> 00:00:56,310
And once you're getting done with them, once you're done with them, you will move on to the next commands.
14
00:00:56,370 --> 00:00:57,750
So you run some commands.
15
00:00:57,900 --> 00:00:58,620
You're finished.
16
00:00:58,740 --> 00:01:00,390
You're moving onto the next commands.
17
00:01:01,110 --> 00:01:07,290
But there will be times when you would like to take some commands and repeat them, repeat some block
18
00:01:07,290 --> 00:01:10,110
of code, not just running at once.
19
00:01:10,250 --> 00:01:17,280
And one way to do so is by using a copy and paste technique and well, simply to copy some commands
20
00:01:17,280 --> 00:01:21,240
and then beat them in your code as many times as you would like.
21
00:01:21,330 --> 00:01:23,550
So that would be option number one.
22
00:01:23,790 --> 00:01:30,780
And although this messy approach may work for some tasks, there are other challenges that this approach
23
00:01:30,780 --> 00:01:32,940
will not even be capable of solving.
24
00:01:33,090 --> 00:01:39,510
And luckily for us, as the future awesome programmers who know all the programming concepts right,
25
00:01:39,660 --> 00:01:45,870
once we started loops, we'll be able to write such cool programs that we'll be capable of repeating
26
00:01:45,870 --> 00:01:51,600
the same task, the same code over and over again until we tell it to stop.
27
00:01:51,720 --> 00:01:58,410
And this will be done by using these awesome loops, statements instead of these messy copy and paste
28
00:01:58,410 --> 00:01:58,950
approach.
29
00:01:59,250 --> 00:02:05,340
So in this section, we are going to talk about loops and explaining details, what is a loop concept
30
00:02:05,610 --> 00:02:11,850
and take a look into a couple of different types of loops, including while loops and for loops.
31
00:02:12,330 --> 00:02:14,460
And we will learn how they can be used.
32
00:02:14,730 --> 00:02:16,950
What are the differences between each of them?
33
00:02:17,220 --> 00:02:22,020
What are the similarities and when you should prefer using one over the other?
34
00:02:22,170 --> 00:02:27,630
We will also talk about what is an iteration and what it has to do with loops.
35
00:02:27,780 --> 00:02:30,180
We will see how we can get out of loops.
36
00:02:30,270 --> 00:02:32,100
What are the commands to do so?
37
00:02:32,430 --> 00:02:38,310
And what loops have to do with the control, flow and conditions that we've learned in the previous
38
00:02:38,310 --> 00:02:38,970
sections.
39
00:02:39,120 --> 00:02:45,480
Also, if we will have time, we are going to take a look at a couple of examples and the concept of
40
00:02:45,480 --> 00:02:51,190
using nested loops, which is similar to nested conditions just with loops.
41
00:02:51,330 --> 00:02:54,180
It simply loops inside loops.
42
00:02:54,240 --> 00:03:00,060
So basically is going to be fun and we will just enjoy this lesson a lot.
43
00:03:00,870 --> 00:03:06,780
So in addition to all the interesting concepts that we are going to learn in this section, you are
44
00:03:06,780 --> 00:03:14,460
also going to develop a really cool program that is going to answer the ten cents versus million dollar
45
00:03:14,550 --> 00:03:21,810
question, which basically stands for if you would rather have one million dollars right now or you
46
00:03:21,810 --> 00:03:29,040
would rather have one cent knowing that it will be doubled every day for the next 30 days.
47
00:03:29,190 --> 00:03:35,790
And what you are going to do is you're going to develop a program that will be able to calculate and
48
00:03:35,880 --> 00:03:38,460
answer this very interesting question.
49
00:03:38,550 --> 00:03:44,310
So later on, you may either a share the school question as well as these program with your friends
50
00:03:44,310 --> 00:03:46,290
and colleagues to see what they think of it.
51
00:03:46,470 --> 00:03:52,740
And to let them choose what they think they would take and probably to prove them wrong.
52
00:03:52,950 --> 00:03:55,010
So I hope you're ready for this section.
53
00:03:55,200 --> 00:03:57,120
And let's get started.
5519
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.