NEW
Font size
WorksheetsU4/L2 HS Kira- Fun with Functions
Total questions: 12
Worksheet time: 6mins
Which of the following is something you should do after watching the videos in this lesson?
Write down facts you learned that you want to remember.
Ignore the information presented in the videos.
Only focus on the images in the videos.
Memorize every word spoken in the videos.
A ______________ is a block of organized, reusable code used to perform a specific task in a program.
function
variable
loop
array
One benefit of using functions is that they help make your code more ______________ and easier to read.
organized
confusing
lengthy
random
In Python, you define a function using the keyword ______________.
def
func
define
function
In the example above, greet is the ______________ of the function.
name
parameter
return value
argument
______________ refers to the rules for how code must be written so that it runs properly.
Syntax
Algorithm
Variable
Function
Once a function is defined, you can use it again by ______________ it in your code.
calling
deleting
ignoring
commenting
Reusing functions helps improve ______________ ______________, meaning your program runs more smoothly and avoids repeating the same code.
code efficiency
code length
code color
code errors
In the "Painting Orange Rows" activity, you used a function to simplify the task of painting ______________ in a repeated pattern.
orange rows
blue columns
green circles
yellow squares
The "Functions for Songs" activity showed how functions can be used to reduce ______________ by organizing repeating lines into a single function call.
repetition
confusion
melody
volume
Functions are especially helpful for organizing code when a task needs to be done ______________ times in a program.
multiple
zero
random
single
Why are functions useful in programming?
Functions allow you to write clean, reusable code and also give you more flexibility to build creative, complex programs without repeating yourself.
Functions make programs run slower and harder to understand.
Functions are only used to store data, not to perform actions.
Functions are required only in web development, not in other types of programming.
