Cohort 1: Web Development with Python (AI Technologies)

Functions and types of functions in python

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.

Defining a Function

We can define a function by using the def keyword.

The syntax to declare a function is:

def fun():

print("Welcome to GFG")

Calling a Function

Call a function by simply calling its name, like this :

fun()

Function Arguments

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]



Meeting link is not available right now.
Date
Duration 120 Minutes
Meeting Link