00:01
Hello, welcome to this lesson.
00:02
In this lesson, we'll make a function called calculation.
00:07
This for the first part, then we'll accept two variables, and we'll return the results of additional variables and also the subtraction of the variables.
00:18
So we use the def key word, followed by the name of the function, which we call calculation.
00:29
It takes in two variables.
00:32
So let's have x and let's have y as the variables, right? then in the body of the method, we'll return.
00:46
So let's have the addition first, which is x plus y, then let's have the subtraction, which is x minus y.
00:59
So that is pretty much all that we need.
01:02
We can create.
01:06
So calculation, then we put in 20 and 20 and 10.
01:19
So i expect 20 plus 10, which is 30, then 20 minus 10, which is 10.
01:30
All right, let me clear the console.
01:34
All right, and run again.
01:52
All right, 30 and 10.
01:54
All right.
01:54
Then for the second part, i'm going through the first 10 numbers from one to 10, actually, and doing a sum of the current and the previous numbers.
02:11
All right...