Python Function
Function is a block code which can be reused many times by just calling it.
Defining a function won't give you the output. calling a function will give you the output.
Parameters
while defining a function, variables which we pass is called is an parameter.
Arguments
While calling a function, value which we pass is called arguments.
one thing, we need to make sure that number of parameter should always equal to number of arguments else python will throw an error.
Variable length Arguments
By passing * in parameters, we can make our functions variable length function.
Default Parameters
while defining a function, we can make a parameter default.
Print Vs Return
print will just print a value. function will not return any value and you cannot store it in another variable.
In the above example, we can see that value returned by an function is stored in a variable.
Lambda function
It is an anonymous function which means it doesn't have any name and everything is written on a single line.
on left side of the semicolon we will write the variables and on right side of it, we will write the expression which will return a value.