00:01
Hello, welcome to this lesson.
00:02
In this lesson, we write a python function that will print the number of lines that the user would input, but in this format, so if they enter with 3, we're going to have the first line as 1, the second as 1, 2 third as 1, 2, 3.
00:22
If they enter 4, the fourth line will have 1, 2, 3 and 4.
00:26
If they enter 5, we'll have 1, 2, 3, 4, 5.
00:30
Okay, so let's go on.
00:33
The first thing is to define this function.
00:36
We call it lines.
00:39
We put in the parameter that is the number of lines the user would want.
00:43
Now, let's have result, a variable that will actually carry the successive results.
00:51
Now, i'm going to use a for loop to go through the counting item from 1 up to n.
01:01
So i have for i in range.
01:06
The range i'm going to start it from 1 and go up to n plus 1, which is to say to go to n.
01:16
Because for the range we have inclusive -exclusive, so we'll start from 1 and actually goes to n plus 1 minus 1, which is actually n.
01:27
So for this, i'm going to say the result plus equals to i.
01:35
So when it starts, it is going to be 1.
01:38
Okay, then i'll print it.
01:40
Let me print the results.
01:42
Then i'm going to move the place value to the next place value.
01:49
So for example, if i have 1, i'm going to multiply it by 10...