
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
11 questions
Teenager 5 Session 24: Pronunciation & Speaking
Presentation
•
KG
15 questions
Computers and Devices
Presentation
•
KG - University
13 questions
Mixed Conditional
Presentation
•
12th Grade
14 questions
CAPTION TEXT
Presentation
•
12th Grade
12 questions
SECOND CONDITIONAL
Presentation
•
12th Grade
14 questions
Presentation
Presentation
•
12th Grade
12 questions
Living Things
Presentation
•
KG
13 questions
Case Study - Data Destruction By Mr. B
Presentation
•
12th Grade
Popular Resources on Wayground
24 questions
PBIS-HGMS Day 10
Quiz
•
6th - 8th Grade
10 questions
HCS SCI 03 Summer School Review 3
Quiz
•
3rd Grade
11 questions
Home Scope
Quiz
•
7th - 8th Grade
15 questions
HCS SCI 05 Summer School Assessment 3 Review
Quiz
•
5th Grade
35 questions
Lufkin Road Middle School Student Handbook & Policies Assessment
Quiz
•
7th Grade
18 questions
Geo 11.3 Area of Circles and Sectors
Quiz
•
9th - 11th Grade