WorksheetsU1/L5 JH Kira - Decomposition using Functions Lesson
Total questions: 24
Worksheet time: 12mins
A ________________ is a named block of code that performs a specific task.
function
variable
loop
class
____________________ is the process of breaking a problem or task down into smaller pieces.
Decomposition
Iteration
Abstraction
Automation
When we are creating a function, we use `def`, which stands for _________________?
define
default
defer
delete
In Python, we use ________________ to show which lines of code are in the function.
indentation
brackets
semicolons
parentheses
When we want to use a function we've created, and make it run, we need to ________________ the function.
call
write
define
declare
To call a function, we use the ______________ of the function.
name
type
value
address
5) `turn_right()` and `turn_left()` are ________________ that were written by someone else that we can now make use of to help the platypus.
functions
variables
loops
conditions
A ________________ is a variable that serves as input to a function.
parameter
constant
operator
statement
You can call a function from inside another ________________. For example, Jagriti called 'paint' from inside the function `paint_row`.
function
variable
loop
class
In the definition of the `paint_row` function, the name of the parameter it has is ________________.
color_to_paint
row_number
paint_type
brush_size
In the final version of Jagriti’s code, the first time the function `paint_row` is called, the value of `color_to_paint` is __________.
red
blue
green
yellow
Functions with Parameters 5) Parameters allow functions to do the same task with different ________________.
values
names
types
locations
Fill in the blank: A ______ is a named block of code that performs a specific task.
function
variable
loop
array
Fill in the blank: ______ is the process of breaking a problem or task down into smaller pieces.
Decomposition
Iteration
Abstraction
Compilation
Fill in the blank: When we are creating a function, we use 'def', which stands for ______.
define
default
definite
defer
Fill in the blank: In Python, we use ______ to show which lines of code are in the function.
indentation
brackets
semicolons
parentheses
Fill in the blank: When we want to use a function we've created, and make it run, we need to ______ the function.
call
define
write
declare
Fill in the blank: To call a function, we use the ______ of the function.
name
type
value
address
True or False: 'turn_right()' and 'turn_left()' are functions that were written by someone else that we can now make use of to help the platypus.
True
False
Fill in the blank: A ______ is a variable that serves as input to a function.
parameter
loop
constant
operator
You can call a function from inside another function.
True
False
Fill in the blank: In the definition of the 'paint_row' function, the name of the parameter it has is ______.
color_to_paint
row_number
paint_type
brush_size
Fill in the blank: In the final version of Jagriti's code, the first time the function 'paint_row' is called, the value of 'color_to_paint' is ______.
red
blue
green
yellow
Parameters allow functions to do the same task with different inputs.
True
False
