0
0
Intro to Computingfundamentals~5 mins

Functions (reusable code blocks) in Intro to Computing - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AStores data permanently
BPerforms a specific task when called
CRepeats the same code multiple times
DDeletes parts of the program
Which of these is a function call?
Agreet()
Bfunction greet
Cdef greet():
Dreturn greet
What do we call the values given to a function to work with?
AVariables
BReturns
CLoops
DParameters
Why is using functions helpful?
AIt helps reuse code and organize programs
BIt hides errors completely
CIt slows down the program
DIt makes the program longer
What is the output of a function?
AThe code inside the function
BThe name of the function
CThe result the function gives back after running
DThe input values
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.