
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
13 questions
Mengenal Program Paint
Presentation
•
12th Grade
13 questions
Sound waves- Part 1
Presentation
•
11th - 12th Grade
10 questions
Plessy v. Ferguson
Presentation
•
12th Grade
13 questions
Present and Past Tenses
Presentation
•
12th Grade
14 questions
Phrasal Verbs
Presentation
•
12th Grade
15 questions
Integumentary System
Presentation
•
12th Grade
14 questions
Ch6.4 ICT IGCSE 0417 Applications Computer Controlled Systems
Presentation
•
12th Grade
13 questions
Exploring Client-Side Processing in Web Development
Presentation
•
12th Grade
Popular Resources on Wayground
10 questions
HCS SCI 03 Summer School Assessment 1
Quiz
•
3rd Grade
15 questions
HCS SCI 05 Summer School Assessment 1 Review
Quiz
•
5th Grade
22 questions
Day 9 Equations and Inequalities Review
Quiz
•
9th Grade
10 questions
Writing and Identifying Ratios Practice
Quiz
•
5th - 6th Grade
7 questions
PYRAMID PERSPECTIVES part 1
Presentation
•
9th - 12th Grade
12 questions
Understanding the Fourth of July
Quiz
•
9th Grade
15 questions
Soccer World Cup Quiz Questions
Quiz
•
7th Grade