
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
Online World Unit 1: databases
Presentation
•
12th Grade
14 questions
Fire Safety
Presentation
•
12th Grade
14 questions
Electron Math
Presentation
•
9th - 12th Grade
12 questions
What is Science?
Presentation
•
KG - 12th Grade
11 questions
1-D Kinematics: Graphing Velocity
Presentation
•
12th Grade
10 questions
El Nino and La Nina Notes
Presentation
•
12th Grade
10 questions
READING COMPREHENSION
Presentation
•
12th Grade
12 questions
Programming Language
Presentation
•
12th Grade
Popular Resources on Wayground
20 questions
STAAR Review Quiz #3
Quiz
•
8th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
6 questions
Marshmallow Farm Quiz
Quiz
•
2nd - 5th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
12 questions
What makes Nebraska's government unique?
Quiz
•
4th - 5th Grade
Discover more resources for Computers
20 questions
Grammar
Quiz
•
9th - 12th Grade
31 questions
Easter Trivia
Quiz
•
KG - 12th Grade
16 questions
Circles - Equations, Central & Inscribed Angles
Quiz
•
9th - 12th Grade
46 questions
Unit 4 Geosphere Test Review
Quiz
•
9th - 12th Grade
30 questions
TSI Writing/Revising and Editing Practice Test
Quiz
•
12th Grade
10 questions
Climate Change and Its Impact
Interactive video
•
9th - 12th Grade
35 questions
Venn Diagrams, Theoretical, & Experimental Review
Quiz
•
9th - 12th Grade
20 questions
Food Chains and Food Webs
Quiz
•
7th - 12th Grade