What is a built-in function?
A ready-to-use command that performs a specific task.
What does add_frame(m) do
Adds a frame to an animation
How do you define a new function in Python?
Using def function_name():
What is a string in Python?
Text enclosed in quotes
What happens if you use background() after heart()
(It covers the heart with background color.)
Give an example of a built-in function used in imagi.
(background(), heart(), character())
Why would you use clear() before adding new characters?
To avoid overlapping designs.)
What are the two main parts of a function?
Header and body
What does concatenation mean?
Joining strings together.)
You try to call a function but get an error saying “name not defined.” What likely went wrong?
You forgot to define the function first with def, or misspelled the name.
What’s the difference between a function and an argument?
(A method or argument belongs to an object, a function doesn’t.)
What’s one way to replace clear()
Use a background color parameter
What does it mean to “call” a function?
To run or use it after defining it.)
What is "Hi! " * 3 equal to?
(“Hi! Hi! Hi! ”)
Give an example of combining lessons: how can a function use a string
(Define a function that displays scrolling text.)
What does the argument in a function do
(It provides extra information the function needs.)
What is the purpose of an animation loop?
To show motion by cycling through frames.)
In the dog example, what parameter changes the eyes?
eye_color
What does scrolling_text(name, Y) do?
(Scrolls text in yellow.)
Why are built-in functions important in coding?
They save time and make code easier to write.)
Which function clears all pixels?
(clear()
What function sets the color behind all pixels?
(background(color))
Why do we use functions in coding?
To organize code, reuse designs, and simplify repetition.)
What’s the difference between a variable and a string
(A variable stores data; a string is a type of data.)
If you write background(G), what does the “G” stand for?
The color green — it’s the argument given to the function.