0% found this document useful (0 votes)
2 views

WhatareFunctions

A function is a code segment designed to perform a specific task, reducing code repetition and minimizing errors. Functions facilitate teamwork by allowing different programmers to work on separate tasks that can later be combined into a single application. Key advantages include easier development, error reduction, team collaboration, and the ability to reuse functions in other projects.

Uploaded by

panwar14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

WhatareFunctions

A function is a code segment designed to perform a specific task, reducing code repetition and minimizing errors. Functions facilitate teamwork by allowing different programmers to work on separate tasks that can later be combined into a single application. Key advantages include easier development, error reduction, team collaboration, and the ability to reuse functions in other projects.

Uploaded by

panwar14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

What are Functions ?

• A function is a piece of code which performs a speci c task


• It is used to reduce the repetition of the code hence reducing the size of the
code, Less chances of making mistakes in the code

• Functions make the task easy for the programmers as each programmer in a
team can be given a speci c task( function ) and at the end we can combine
these task together to make single application.

• Some points to remember are :

- Program is a general term


- A very big program is called application
- An application broke into pieces are called modules that performs a speci c
task

- Modules broken into pieces are called Functions / Procedure

Advantages :

- Easy development
- Error free
- Can be developed by a team of programmers
- Reuse modules for function in other projects

Creating a Function :

Syntax : def Name ( <parameter List >)


……….
……….
……….

return result

• A function must return a result and it python it returns result


• If you don’t write return inside a function then it’ll automatically returns None
fi
fi
fi

You might also like