Its all about the scope of a variable variable defined at the top of all functions will have global scope. variables defined in function are called local variables & the life of that variable is with in the function only . #### Global variable a = 10 #### funtion defination def display(): b=20 print("the value … Continue reading Global and local variables in python
Day: May 26, 2019
Types of arguments in python user-defined function
Types of Arguments There are 4 types how we can pass arguments to functions in python 1) Default arguments 2) Required arguments 3) Keyword arguments 4) Variable number of arguments Default arguments: Default values indicate that the function argument will take that value if no argument value is passed during function call. The default value … Continue reading Types of arguments in python user-defined function
