For the class recording, please contact your course instructor.
For the class recording, please contact your course instructor.
Python Functions:
"Functions in Python are a block of statements that can be executed to perform a specific task."
Here, the concept is to put a commonly or repeatedly done task together and make a function so that instead of writing the same code over and over for different inputs, we can do the function calls to reuse the code over and over again.
why use function?
1- Code reusability.
2- Modularity.
3- Maintainability.
4- Readability.
We can define a function by using the def keyword.
The syntax to declare a function is:
def fun():
print("Welcome to GFG")
Call a function by simply calling its name, like this :
fun()
Arguments are the values passed inside the parenthesis of the function.
A function can have any number of arguments separated by a comma.
def function_name( parameters ):
function_body
return [expression]
| Date | |
| Duration | 120 Minutes |
| Meeting Link |
$refs.clipboardMessage.style.display='none', 1000)" x-init="$el.value = ''">
|
No Comments Yet