Recall & Review
beginner
What is a function in programming?
A function is a reusable block of code that performs a specific task. It helps avoid repeating the same code and makes programs easier to read and maintain.
Click to reveal answer
beginner
Why do we use functions in programming?
Functions help by breaking a program into smaller parts, making it easier to understand, reuse, and test. They save time by avoiding repeated code.
Click to reveal answer
beginner
What is the difference between a function definition and a function call?
A function definition is where you write the code for the function. A function call is when you use or run the function in your program.
Click to reveal answer
intermediate
Explain the concept of input and output in functions.
Functions can take inputs (called parameters) to work with different data. They can also give back results (called return values) after processing.
Click to reveal answer
beginner
How can you think of a function using a real-life analogy?
Think of a function like a coffee machine: you put in coffee beans and water (inputs), press a button (call the function), and get coffee (output). You can use the machine many times without making coffee from scratch each time.
Click to reveal answer
What does a function do in a program?
✗ Incorrect
A function performs a specific task when called, helping to organize and reuse code.
Which of these is a function call?
✗ Incorrect
greet() is a function call that runs the code inside the function named greet.
What do we call the values given to a function to work with?
✗ Incorrect
Parameters are the inputs given to a function to process.
Why is using functions helpful?
✗ Incorrect
Functions help reuse code and organize programs, making them easier to manage.
What is the output of a function?
✗ Incorrect
The output is the result the function returns after processing the inputs.
Explain what a function is and why it is useful in programming.
Think about how functions help you write less code and keep things organized.
You got /4 concepts.
Describe the difference between a function definition and a function call with an example.
One is where you write the code, the other is when you use it.
You got /3 concepts.