Subroutines, Local and Global Variables (AQA A-Level Computer Science): Quizzes

📚Quizzes
Subroutines, Local and Global Variables
Sign up to keep practising.Create a free account to play more quizzes and track your progress.

Practise the questions

10 questions from this quiz

Show

What is a subroutine in programming?

A self-contained code block for tasks

Why are subroutines easier to test and debug?

They are self-contained code blocks

What distinguishes a function from other subroutines?

A function returns a value

What is the difference between a parameter and an argument?

Parameter is placeholder; argument is value

Where can a local variable be accessed?

Only within its specific subroutine

What happens to local variables when a subroutine finishes executing?

They are removed from memory

When should you use a global variable?

When it needs program-wide accessibility

How do you declare a global variable in Python?

Use the global keyword

What are catch blocks used for in exception handling?

Triggered in response to specific errors

What happens immediately after an exception is thrown?

The current state is saved in memory

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

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