We have already explained some basic features of functions in our previous lectures.Before learn this part ,you have to learn function concepts in python part 1.
Types of Arguments:-
There are four types of arguments in python functions as given below:-
- Required arguments or Positional arguments.
- Keyword arguments
- Default arguments
- Variable Length arguments
1.) Required arguments or Positional arguments
Required arguments must be passed in correct positional order.For example,if a function want an int, float and string to be passed it,then the call to this function should look like:
func(10,5.12,'MNT LAB') #Correct function call
func(5.12,10,'MNT LAB') #Incorrect function call gives error
In required arguments number of arguments passed must be match with number of arguments received.
3