SlideShare a Scribd company logo
FUNCTIONS
FUNCTION DEFINITION
Definition includes:
 return value: the value the function returns to the part of
the program that called it
 name: name of the function. Function names follow
same rules as variables
 parameter list: variables containing
values passed to the function
 body: statements that perform
the function’s task
DECLARING FUNCTION
 Functions just like variables can return(store) a value
 Code:
 Declaring a Function:
 def functionName (Parameters):
Function Body
return *if necessary
 Common Errors: function names are case sensitive,
Trying to return a value with no return statement
CALLING A FUNCTION
Functions just like variables need to be called in
order to be invoked
 Code:
Declaring a Function:
functionName (Parameters)
WRITE AND CALLING FUNCTIONS EXAMPLE

More Related Content

PPTX
Function Parameters
PPTX
Function Returns
PDF
Chapter 11 Function
PPS
Introduction to php 5
PPTX
User defined functions.1
PPT
PPTX
Java script function
PPTX
Cold fusion best practice
Function Parameters
Function Returns
Chapter 11 Function
Introduction to php 5
User defined functions.1
Java script function
Cold fusion best practice

What's hot (20)

PPTX
Functions in c language1
PPTX
INLINE FUNCTION IN C++
PPTX
Inline function
PPTX
Function
PPTX
Command Line Arguments in C#
PDF
Immutability and pure functions
PPTX
Inline function in C++
PPTX
Inline Functions and Default arguments
PDF
Functions and tasks in verilog
PPT
Savitch ch 05
PDF
Php, mysq lpart3
PDF
Functions in php
PPTX
Inline function in C++
PPT
Command line arguments.21
PPT
Timedobserver
PPTX
Function & procedure
PPTX
C++ Functions
PPTX
Inline functions & macros
ODP
C++ Function
PPTX
Returning Data
Functions in c language1
INLINE FUNCTION IN C++
Inline function
Function
Command Line Arguments in C#
Immutability and pure functions
Inline function in C++
Inline Functions and Default arguments
Functions and tasks in verilog
Savitch ch 05
Php, mysq lpart3
Functions in php
Inline function in C++
Command line arguments.21
Timedobserver
Function & procedure
C++ Functions
Inline functions & macros
C++ Function
Returning Data
Ad

Viewers also liked (6)

PPT
Intro to Lists
PPT
Formatting Output
PPT
Intro to Jeroo Python
PPT
Intro to Functions Python
PPTX
For Loops and Nesting in Python
PPT
Conditional Loops Python
Intro to Lists
Formatting Output
Intro to Jeroo Python
Intro to Functions Python
For Loops and Nesting in Python
Conditional Loops Python
Ad

Similar to Functions (20)

PPTX
Intro to Functions
PPTX
PPTX
functions new.pptx
PPTX
Functions in C
PPTX
function of C.pptx
PPTX
User defined function in C.pptx
PPTX
use of Functions to write python program.pptx
PPT
Ch4 functions
PPTX
04. WORKING WITH FUNCTIONS-2 (1).pptx
DOC
4. function
PPTX
Functions in Python Programming Language
PPTX
Learn more about the concepts Functions of Python
PDF
1.6 Function.pdf
PDF
functions notes.pdf python functions and opp
PDF
Lecture 2.1 Functions.pdf
PPTX
Functions
PPTX
Functions
PPTX
Functions.pptx
PPTX
10 Functions.pptx DSDFDFDFDFDFDFDFDFFDFDFD
PPTX
Functions in c language
Intro to Functions
functions new.pptx
Functions in C
function of C.pptx
User defined function in C.pptx
use of Functions to write python program.pptx
Ch4 functions
04. WORKING WITH FUNCTIONS-2 (1).pptx
4. function
Functions in Python Programming Language
Learn more about the concepts Functions of Python
1.6 Function.pdf
functions notes.pdf python functions and opp
Lecture 2.1 Functions.pdf
Functions
Functions
Functions.pptx
10 Functions.pptx DSDFDFDFDFDFDFDFDFFDFDFD
Functions in c language

More from primeteacher32 (20)

PPT
Software Development Life Cycle
PPTX
Variable Scope
PPTX
Introduction to GUIs with guizero
PPTX
Function Parameters
PPTX
Nested Loops
PPT
Conditional Loops
PPTX
Introduction to Repetition Structures
PPTX
Input Validation
PPTX
Windows File Systems
PPTX
Nesting Conditionals
PPTX
Conditionals
PPT
Intro to Python with GPIO
PPTX
Variables and Statements
PPTX
Variables and User Input
PPT
Intro to Python
PPTX
Raspberry Pi
PPT
Hardware vs. Software Presentations
PPTX
Block chain security
PPTX
PPTX
System Administration
Software Development Life Cycle
Variable Scope
Introduction to GUIs with guizero
Function Parameters
Nested Loops
Conditional Loops
Introduction to Repetition Structures
Input Validation
Windows File Systems
Nesting Conditionals
Conditionals
Intro to Python with GPIO
Variables and Statements
Variables and User Input
Intro to Python
Raspberry Pi
Hardware vs. Software Presentations
Block chain security
System Administration

Recently uploaded (20)

PDF
ELA Parts of Speech Pronoun Educational Presentation in Green 3D Gradient Sty...
PPTX
Principles of Inheritance and variation class 12.pptx
PPT
Gsisgdkddkvdgjsjdvdbdbdbdghjkhgcvvkkfcxxfg
PPTX
employee on boarding for jobs for freshers try it
PDF
Women’s Talk Session 1- Talking about women
PPT
pwm ppt .pdf long description of pwm....
PPTX
The Stock at arrangement the stock and product.pptx
PPT
ALLIED MATHEMATICS -I UNIT III MATRICES.ppt
PPT
NO000387 (1).pptsbsnsnsnsnsnsnsmsnnsnsnsjsnnsnsnsnnsnnansnwjwnshshshs
PPTX
A slide for students with the advantagea
PDF
Shopify Store Management_ Complete Guide to E-commerce Success.pdf
PPTX
ChandigarhUniversityinformationcareer.pptx
PDF
Beyond the Lab Coat - Perjalanan Karier di Dunia Pasca-Fisika S1
PPTX
Slideham presentation for the students a
PDF
APNCET2025RESULT Result Result 2025 2025
PPT
BCH3201 (Enzymes and biocatalysis)-JEB (1).ppt
PPTX
AREAS OF SPECIALIZATION AND CAREER OPPORTUNITIES FOR COMMUNICATORS AND JOURNA...
PPTX
Prokaryotes v Eukaryotes PowerPoint.pptx
PPTX
FINAL PPT.pptx cfyufuyfuyuy8ioyoiuvy ituyc utdfm v
DOCX
PRACTICE-TEST-12 is specially designed for those
ELA Parts of Speech Pronoun Educational Presentation in Green 3D Gradient Sty...
Principles of Inheritance and variation class 12.pptx
Gsisgdkddkvdgjsjdvdbdbdbdghjkhgcvvkkfcxxfg
employee on boarding for jobs for freshers try it
Women’s Talk Session 1- Talking about women
pwm ppt .pdf long description of pwm....
The Stock at arrangement the stock and product.pptx
ALLIED MATHEMATICS -I UNIT III MATRICES.ppt
NO000387 (1).pptsbsnsnsnsnsnsnsmsnnsnsnsjsnnsnsnsnnsnnansnwjwnshshshs
A slide for students with the advantagea
Shopify Store Management_ Complete Guide to E-commerce Success.pdf
ChandigarhUniversityinformationcareer.pptx
Beyond the Lab Coat - Perjalanan Karier di Dunia Pasca-Fisika S1
Slideham presentation for the students a
APNCET2025RESULT Result Result 2025 2025
BCH3201 (Enzymes and biocatalysis)-JEB (1).ppt
AREAS OF SPECIALIZATION AND CAREER OPPORTUNITIES FOR COMMUNICATORS AND JOURNA...
Prokaryotes v Eukaryotes PowerPoint.pptx
FINAL PPT.pptx cfyufuyfuyuy8ioyoiuvy ituyc utdfm v
PRACTICE-TEST-12 is specially designed for those

Functions

  • 2. FUNCTION DEFINITION Definition includes:  return value: the value the function returns to the part of the program that called it  name: name of the function. Function names follow same rules as variables  parameter list: variables containing values passed to the function  body: statements that perform the function’s task
  • 3. DECLARING FUNCTION  Functions just like variables can return(store) a value  Code:  Declaring a Function:  def functionName (Parameters): Function Body return *if necessary  Common Errors: function names are case sensitive, Trying to return a value with no return statement
  • 4. CALLING A FUNCTION Functions just like variables need to be called in order to be invoked  Code: Declaring a Function: functionName (Parameters)
  • 5. WRITE AND CALLING FUNCTIONS EXAMPLE