Computer Science, asked by tejkr22nov8540, 4 months ago

define 'function' in python?

Answers

Answered by ritikasingh9940
3

Answer:

In Python, a function is a group of related statements that performs a specific task.

Functions help break our program into smaller and modular chunks. As our program grows larger and larger, functions make it more organized and manageable.

Furthermore, it avoids repetition and makes the code reusable.

Explanation:

mark me as brainlist pls

Answered by Shresth9Choudhary
0

Answer:

A function is a block of code which only runs when it is called.

You can pass data, known as parameters, into a function.

A function can return data as a result.

Explanation:

In Python a function is defined using the def keyword

Example

def my_function():

 print("Hello from a function")

Similar questions