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)

PPT
Gsisgdkddkvdgjsjdvdbdbdbdghjkhgcvvkkfcxxfg
PPTX
Your Guide to a Winning Interview Aug 2025.
PDF
Parts of Speech Quiz Presentation in Orange Blue Illustrative Style.pdf.pdf
PPTX
Overview Planner of Soft Skills in a single ppt
PPTX
STS CHAP 4 human development as reflected
PPTX
The Stock at arrangement the stock and product.pptx
PPTX
Principles of Inheritance and variation class 12.pptx
PPTX
AREAS OF SPECIALIZATION AND CAREER OPPORTUNITIES FOR COMMUNICATORS AND JOURNA...
PDF
Biography of Mohammad Anamul Haque Nayan
PPTX
microtomy kkk. presenting to cryst in gl
PDF
Understanding the Rhetorical Situation Presentation in Blue Orange Muted Il_2...
PDF
APNCET2025RESULT Result Result 2025 2025
PPTX
Slideham presentation for the students a
PPTX
A slide for students with the advantagea
PPTX
FINAL PPT.pptx cfyufuyfuyuy8ioyoiuvy ituyc utdfm v
PPTX
Condensed_Food_Science_Lecture1_Precised.pptx
PPTX
CYBER SECURITY PPT.pptx CYBER SECURITY APPLICATION AND USAGE
PDF
Shopify Store Management_ Complete Guide to E-commerce Success.pdf
PDF
MCQ Practice CBT OL Official Language 1.pptx.pdf
PDF
iTop VPN Crack Latest Version 2025 Free Download With Keygen
Gsisgdkddkvdgjsjdvdbdbdbdghjkhgcvvkkfcxxfg
Your Guide to a Winning Interview Aug 2025.
Parts of Speech Quiz Presentation in Orange Blue Illustrative Style.pdf.pdf
Overview Planner of Soft Skills in a single ppt
STS CHAP 4 human development as reflected
The Stock at arrangement the stock and product.pptx
Principles of Inheritance and variation class 12.pptx
AREAS OF SPECIALIZATION AND CAREER OPPORTUNITIES FOR COMMUNICATORS AND JOURNA...
Biography of Mohammad Anamul Haque Nayan
microtomy kkk. presenting to cryst in gl
Understanding the Rhetorical Situation Presentation in Blue Orange Muted Il_2...
APNCET2025RESULT Result Result 2025 2025
Slideham presentation for the students a
A slide for students with the advantagea
FINAL PPT.pptx cfyufuyfuyuy8ioyoiuvy ituyc utdfm v
Condensed_Food_Science_Lecture1_Precised.pptx
CYBER SECURITY PPT.pptx CYBER SECURITY APPLICATION AND USAGE
Shopify Store Management_ Complete Guide to E-commerce Success.pdf
MCQ Practice CBT OL Official Language 1.pptx.pdf
iTop VPN Crack Latest Version 2025 Free Download With Keygen

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