For number six, we have to bring the numbers from one to 1000.
Again, we'll start with our boilerplate.
I created the folder inside the project, created the partner, I can start writing it, so package
me on name.
And I usually I always start by, I'll pick your world first in order to verify that everything is working
properly and everything is set up.
So I run my program now and I get hello work.
OK, so that's perfectly fine.
One thing to note is that you should be careful that you're running this from the right directory and
the rectory is actually shown here.
And what is that?
It says zero six underscore print numbers one to 1000.
If this is different for you than what you have to do is right click and open the integrated terminal
and then you'll be in the right direction.
OK, so this is just a caveat to be aware of.
All right now, let's check out one of the exercises.
We have to bring the numbers for one to 1000.
The example says it's all says it.
Of course we don't.
We aren't expected to bring these dots here.
They're just illustrations so that they don't make this document extra large.
But obviously, one way to do it is to start doing this, and they will need to just go here and start
having been one.
Three, etc. And this is it should be Fisher two, it seems way too strange, right?
It's like that.
So there must be a better way when something appears to be very hard, at least in this course, and
the cold tends to be larger than it feels it should be.
Then something might be wrong.
And here we have a hint.
We have to learn about four loops and go like, I don't know what the four the.
So let's check it out.
That's right.
Or little Roland.
And I get several links.
One is toward those who go along the door, all this is a nice site where you have very simple examples
and some explanation for them.
Well, this is a bit to the info here is not detailed enough for a beginner, so I don't really suggest
you check this out.
Instead, try to go by example.
And go by example is another nice site you can use.
And let's see what it says or is goes only looping, construct, whatever that is.
There are some basic types now the words here, the terminology might be a bit strange, but the important
thing for us is to check out the examples.
And here it shows the scope, and it's very clear what it does now.
Note is that what we.
And get at least around this part of the program is that we get some numbers printed in some order.
We have one two three seven eight nine.
So this seems like something which serves our purpose.
And let's try tinkering with it and see if we can extract something useful from this example, so I'll
just copy this gold and just try placing it here and see without fully understanding it.
I want to see what it does by running it.
And after I run it, I get one two three.
Oh, so maybe this colt can actually print numbers from one to three.
It might actually serve our purpose.
We have to bring the numbers for a one to one 1000.
All we need to do is learn a way to hack it such that we don't get the numbers from one to three.
We get the numbers from one to 1000.
Now let's check out the code without fully understanding it.
Can you guess which thing we might have to modify in order to make it work?
Well, let's try it out.
Let's just start playing with it.
For example, let's try changing this very little to something small versus not changing it too much
in order to not break the whole program.
If we change this, we see that the value we get is 20.
Also, maybe.
It seems like when we change this value, the effect on the program is that we change the initial value
we start from.
If we change to three and I run it again, we just get the number at three.
So it seems this controls, which is the initial value.
Let's just return it to one because that is what we need it.
Then the second, the interesting part is this number three here, let's try tinkering with it.
Let's change it to five.
If I change it to five and I run my program.
I'll get the numbers one two three four five.
Also, there's actually there's good progress.
We were able to print out not only the first two numbers, but the first five.
It appears that this number controls what is the final number until which we have to print stuff.
So let's be ambitious.
Let's try changing it to 1000, which is what our exercise wants us to do.
What will happen then, if I run my program?
Oh wow.
Do you see the magic, not what happened here, if I scroll to the top, which I have to scroll a lot.
If I scroll to the top notice that I get in the numbers one, two three, four, five, six seven and
all the way.
One thousand, which is actually what was expected by us, so by tinkering a bit with this program again,
without feeling that extending it, we were able to solve the exercise now as an extra challenge.
If you want, I suggest you go here and try messing with some of the other things.
There aren't a lot actually left.
We messed with this and this one, but we didn't really change this.
Why don't you go ahead and try playing with this and see what you get?
Maybe it might be an interesting result we don't expect.
So try playing around with the program and exploring a little bit.
Imagine this is a puzzle which you don't fully understand, but are really interested in learning more
about it.
So go ahead and try playing around with it and see what you get.
OK, so that's it for exercise number six.