Hello and welcome to this video.
If you want a function to return a value you need to use the return keyword inside the function definition.
So let's create a basic function.
Some women create a function called some and inside the parentheses.
I'm going to give it to parameters X and Y.
Once I've done that I will add my colon and press enter and then instead of adding a function body or
the code that will execute.
I can just add a return and I can tell it what to return.
I wanted to return the value of x plus y.
So that's basically how you use the return keyword to call this function to return the value I can use
the print function so I can say print.
And inside that print function I can add the name of my function which is called Sum and now add parent
sees and then passing some arguments for the parameter.
So I say 4 5 and I'll just create another one below I'll say print and again the name of my function
add the parent theses and I just passing two other arguments.
So now what they should do when I play the file is should print out or return the value of Form 5.
So it which are the these two are arguments these two are arguments for the parameter.
So let me click on the play button and you can see here is returned some value.
So when I call the print function of past in the function which is some and then passed in some argument
4 and 5 I said here in the return statement to return the value of X plus Y which is what it has done
here X is for.
Why is 5.
So if you add them together I give you a 9.
Same thing here on line 5 8 is X and 4 is why if you add them together it gives you twelve.
So that's basically how you use return keyword inside your function definition.
Thank you for watching and bye for now.