Parameters (OCR A-Level Computer Science): Quizzes
📚Quizzes
Practise the questions
12 questions from this quiz
ShowHide
Practise the questions
12 questions from this quiz
What are parameters in programming?
What are parameters in programming?
Variables to pass data to functions
What is the difference between parameters and arguments?
What is the difference between parameters and arguments?
Parameters are placeholders; arguments are values
What are positional parameters?
What are positional parameters?
Arguments passed in same order as defined
What happens when no argument is provided for a default parameter?
What happens when no argument is provided for a default parameter?
The default value is used
What are keyword parameters?
What are keyword parameters?
Arguments passed using parameter names
What happens when passing by value?
What happens when passing by value?
A copy is passed; original unchanged
What happens when passing by reference?
What happens when passing by reference?
A reference is passed; original changed
In Python, which data types are passed by value?
In Python, which data types are passed by value?
Immutable types like integers/strings
In Python, which data types are passed by reference?
In Python, which data types are passed by reference?
Mutable types like lists/dictionaries
What is a benefit of passing by value?
What is a benefit of passing by value?
Original data is not modified
What is a drawback of passing by reference?
What is a drawback of passing by reference?
Original data can be accidentally modified
When should you use passing by reference?
When should you use passing by reference?
To modify original data or pass large structures
