Parameters (OCR A-Level Computer Science): Quizzes

📚Quizzes
Parameters
Sign up to keep practising.Create a free account to play more quizzes and track your progress.

Practise the questions

12 questions from this quiz

Show

What are parameters in programming?

Variables to pass data to functions

What is the difference between parameters and arguments?

Parameters are placeholders; arguments are values

What are positional parameters?

Arguments passed in same order as defined

What happens when no argument is provided for a default parameter?

The default value is used

What are keyword parameters?

Arguments passed using parameter names

What happens when passing by value?

A copy is passed; original unchanged

What happens when passing by reference?

A reference is passed; original changed

In Python, which data types are passed by value?

Immutable types like integers/strings

In Python, which data types are passed by reference?

Mutable types like lists/dictionaries

What is a benefit of passing by value?

Original data is not modified

What is a drawback of passing by reference?

Original data can be accidentally modified

When should you use passing by reference?

To modify original data or pass large structures

Explore OCR A-Level Computer Science Revision Notes by Topics

Explore OCR A-Level Computer Science Model Answers by Topics

Explore OCR A-Level Computer Science Flashcards by Topics

Explore OCR A-Level Computer Science Exam Questions by Topics

Join 100,000+ A-Level students studying Quizzes with us.

Select your subjects, and get access to A+ resources today.