
Python- Function (Parameter, Argument and Return)
Presentation
•
Computers
•
12th Grade
•
Medium
Tshering Tshering
Used 51+ times
FREE Resource
14 Slides • 4 Questions
1
PARAMETER,
ARGUMENT AND
RETURN
2
PARAMETER
IN PYTHON FUNCTION
3
Parameters
■ A parameter is the variable listed inside
the parentheses in the function definition.
■ Here, a and b is the function parameter.
4
Default Parameter
■ A default parameter is set when the default
value is already assigned when defining a
function.
Output
5
ARGUMENT
IN PYTHON FUNCTION
6
Arguments
■ Arguments are specified after the
function name, inside the parentheses.
When we call the function, the value passed
(10 & 20) to the parentheses is called the
function’s arguments.
7
}
The number 10 and 20 will be passed to a and b in
the function parameter respectively.
And later it was passed to the function body/
statement.
8
Parameter Vs Argument
➢ Parameter is the variable you give to function
when you define the function.
➢ When the function is called the argument(s)
are the data you pass into the function
parameter.
➢ Argument is the actual value of the variable
that gets passed to the function.
9
Quiz Time.
Get ready
10
Multiple Choice
Parameter is the variable you give to function.
True
False
None of the above.
11
Multiple Choice
How many parameters can we use in each function?
1
2
5
As many as we need
12
Fill in the Blanks
Type answer...
13
Multiple Choice
What is the correct way to create a function in Python?
def myFunction():
function myFunction():
Create myFunction():
DEF myFunction():
14
RETURN
IN PYTHON FUNCTION
15
o Return statement is used to end the
execution of the function call and returns
the result.
o The statement after the return statement
is not executed.
o Return statement can not be used outside
the function.
Return statement
16
Example
Output
17
Output
18
Activity
■ 1. Write a python code to find
Area of a Rectangle using function and passing
parameter and argument.
■ 2. Write a python code to find
Area of a Square using function and passing
parameter and argument.
PARAMETER,
ARGUMENT AND
RETURN
Show answer
Auto Play
Slide 1 / 18
SLIDE
Similar Resources on Wayground
14 questions
Cardiovascular System
Presentation
•
12th Grade
13 questions
Clase 1 - Introducción a la Programación
Presentation
•
11th - 12th Grade
15 questions
Inflation
Presentation
•
12th Grade
13 questions
Ilmu Pengetahuan Alam
Presentation
•
KG
13 questions
Data Collection Methods
Presentation
•
12th Grade
12 questions
Fingerprints!
Presentation
•
12th Grade
12 questions
The Imaginary Numbers
Presentation
•
12th Grade
12 questions
Types of Unemployment
Presentation
•
12th Grade
Popular Resources on Wayground
6 questions
Secondary Safety Quiz
Presentation
•
9th - 12th Grade
10 questions
MyPath Diagnostic Overview
Presentation
•
6th - 8th Grade
20 questions
Lab Safety Quiz
Quiz
•
6th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Adding and Subtracting Decimals
Quiz
•
5th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
21 questions
Lab Safety
Quiz
•
10th Grade