Python Functions
There are two types of functions in python. Non-return type functions and Return type functions.
Non-return type functions
def - keyword is used to define a function.
We can define parameters in a function and call it with passing arguments.
In this case we have used two arguments.
Sructure
def name_Function(parameter1,prameter2):
Body
name_Function(argument1,argument2)
An example,
In the above example we pass the values 10 and 20 (arguments) to the num1 and num2 (parameters) and calculate the total.
Below code will throw an error since we use only one argument to call the function even though we define two parameters.
Return type functions
return - keyword is used to return a value.
Therefore we can fetch that value using a varaiable and print it.
The below code is will calculate the area, and also you can identify that print("bye") statement won't get executed.
Another topic to focus on is default arguments.