0% found this document useful (0 votes)
6 views1 page

Functions in Python

Functions in Python are designed to perform specific tasks and enhance code reusability. They consist of a function definition and function calls, with each definition existing only once and requiring a call to execute. Key phases of a function include taking input, processing it, and providing output.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Functions in Python

Functions in Python are designed to perform specific tasks and enhance code reusability. They consist of a function definition and function calls, with each definition existing only once and requiring a call to execute. Key phases of a function include taking input, processing it, and providing output.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

===========================================================

Functions in Python
===========================================================
=>The purpose of Functions is that " To Perform Certain Operation /Task and
Provides Code Re-Usability".
=>The Advantages of Functions in any languages are
1. Application Development time is Less
2. Application Memory Space is Less
3. Application Execution Time is Less
4. Application Performance is Enhanced
5. Redundency of the Code is Minimized
-----------------------------------------------------------------------------------
---------------------------------------------
Definitions of Function
-----------------------------------------------------------------------------------
---------------------------------------------
=>Sub Program of Main Program is Called Function.
(OR).
=>A Part of main program is Called Function.
-----------------------------------------------------------------------------------
---------------------------------------------
Parts of Functions
-----------------------------------------------------------------------------------
---------------------------------------------
=>At the time Developing functions in real time, we must ensure that, there must
exist 2 Parts. they are
1. Function Definition
2. Function Calls
=>Every Function Definition Exists Only Once
=>Every Function call must contains a Function Defintion Otherwise we get
NameError.
=>Function Definition will execute when we call by using function calls OR Without
calling the
Function by using Function Calls, PVM will not execute Function Definition.
-----------------------------------------------------------------------------------
---------------------------------------------
Phases in Functions
-----------------------------------------------------------------------------------
---------------------------------------------
=>At the time Defining the functions, the Programmer must ensure that there must
exist the following Phases.
1. Every Function Must take an INPUT
2. Every Function Must PROCESS the Input
3. Every Function Must give OUTPUT or RESULT
-----------------------------------------------------------------------------------
--------------------------------------------

You might also like