1
00:00:00,120 --> 00:00:02,840
Hello and welcome to this video.

2
00:00:02,910 --> 00:00:15,950
If you want a function to return a value you need to use the return keyword inside the function definition.

3
00:00:15,960 --> 00:00:18,530
So let's create a basic function.

4
00:00:18,630 --> 00:00:25,990
Some women create a function called some and inside the parentheses.

5
00:00:26,010 --> 00:00:30,450
I'm going to give it to parameters X and Y.

6
00:00:30,600 --> 00:00:41,400
Once I've done that I will add my colon and press enter and then instead of adding a function body or

7
00:00:41,400 --> 00:00:42,890
the code that will execute.

8
00:00:42,960 --> 00:00:47,510
I can just add a return and I can tell it what to return.

9
00:00:47,550 --> 00:00:52,320
I wanted to return the value of x plus y.

10
00:00:52,530 --> 00:01:01,580
So that's basically how you use the return keyword to call this function to return the value I can use

11
00:01:01,590 --> 00:01:04,370
the print function so I can say print.

12
00:01:04,470 --> 00:01:15,640
And inside that print function I can add the name of my function which is called Sum and now add parent

13
00:01:15,670 --> 00:01:20,610
sees and then passing some arguments for the parameter.

14
00:01:20,610 --> 00:01:31,770
So I say 4 5 and I'll just create another one below I'll say print and again the name of my function

15
00:01:32,100 --> 00:01:38,650
add the parent theses and I just passing two other arguments.

16
00:01:39,010 --> 00:01:50,560
So now what they should do when I play the file is should print out or return the value of Form 5.

17
00:01:51,250 --> 00:01:56,070
So it which are the these two are arguments these two are arguments for the parameter.

18
00:01:56,080 --> 00:02:02,050
So let me click on the play button and you can see here is returned some value.

19
00:02:02,920 --> 00:02:12,490
So when I call the print function of past in the function which is some and then passed in some argument

20
00:02:12,490 --> 00:02:20,800
4 and 5 I said here in the return statement to return the value of X plus Y which is what it has done

21
00:02:20,800 --> 00:02:23,530
here X is for.

22
00:02:23,530 --> 00:02:24,490
Why is 5.

23
00:02:24,490 --> 00:02:27,190
So if you add them together I give you a 9.

24
00:02:27,190 --> 00:02:35,110
Same thing here on line 5 8 is X and 4 is why if you add them together it gives you twelve.

25
00:02:35,140 --> 00:02:41,900
So that's basically how you use return keyword inside your function definition.

26
00:02:41,920 --> 00:02:44,050
Thank you for watching and bye for now.
