Functions (Edexcel GCSE Computer Science): Quizzes
📚Quizzes
Practise the questions
12 questions from this quiz
ShowHide
Practise the questions
12 questions from this quiz
What is a function in programming?
What is a function in programming?
A special subprogram that returns a value
What is the main benefit of using functions?
What is the main benefit of using functions?
Code reusability and organization
Which keyword must you use to create a function in Python?
Which keyword must you use to create a function in Python?
def
What are parameters in a function?
What are parameters in a function?
Containers storing values from main program
Where can local variables be accessed?
Where can local variables be accessed?
Only within the function they're created in
What does a return statement do?
What does a return statement do?
Sends a result back to the main program
What does it mean to 'call' a function?
What does it mean to 'call' a function?
To use the function
What is the difference between arguments and parameters?
What is the difference between arguments and parameters?
Arguments are passed TO; parameters receive
What prefix is recommended for naming parameters?
What prefix is recommended for naming parameters?
The letter 'p'
When should you use functions?
When should you use functions?
When performing same calculation many times
Why is local scope helpful in functions?
Why is local scope helpful in functions?
Prevents variables interfering with main
What is a common mistake when using functions?
What is a common mistake when using functions?
Forgetting to call function after defining
