Question 1
What is meant by variable scope?
-
Where in a program a variable can be accessed
-
How many bytes a variable stores
-
The speed at which a variable changes
-
The colour used to display a variable in an IDE
Question 2
What is defensive design in programming mainly for?
-
Preventing or handling invalid input and unexpected use
-
Making comments longer for readability
-
Replacing all loops with recursion
-
Ensuring code only runs on one device
Question 3
In Python, what does int(4.9) return?
-
4
-
5
-
4.9
-
Error
Question 4
Which data structure follows First In, First Out (FIFO)?
-
Queue
-
Stack
-
Array
-
Dictionary
Question 5
Which data structure follows Last In, First Out (LIFO)?
-
Stack
-
Queue
-
Tuple
-
Hash table
Question 6
In Python file handling, what does mode 'a' do?
-
Opens a file for appending
-
Opens a file for reading only
-
Opens a file for writing and overwrites existing content
-
Creates a read-only temporary copy
Question 7
Which three control structures are fundamental in structured programming?
-
Sequence, selection and iteration
-
Input, output and storage
-
Sort, search and merge
-
Syntax, semantics and style
Question 8
What is the difference between a procedure and a function?
-
A function returns a value, while a procedure does not
-
A procedure can use loops but a function cannot
-
A function can only be written in pseudocode
-
A procedure must be global but a function must be local
Question 9
In Python, what does list_name.pop() do with no index given?
-
Removes and returns the last item in the list
-
Returns the first item without removing it
-
Sorts the list in descending order
-
Clears all items from the list
Question 10
Why should identifier names in code be meaningful?
-
They make code easier to understand, test and maintain
-
They reduce RAM usage significantly
-
They automatically fix runtime errors
-
They prevent all syntax mistakes
Question 11
Which data type stores whole numbers?
-
Integer
-
Real
-
Boolean
-
Character
Question 12
Which data type stores true/false?
-
Boolean
-
Integer
-
String
-
Character
Question 13
Which operator gives the remainder?
-
MOD
-
DIV
-
/
-
*
Question 14
Which Boolean operator is true only when both conditions are true?
-
AND
-
OR
-
NOT
-
XOR
Question 15
Which Boolean operator is true when at least one condition is true?
-
OR
-
AND
-
NOT
-
DIV
Question 16
What is the result of applying NOT to TRUE?
-
FALSE
-
TRUE
-
1
-
NULL
Question 17
What is a one-dimensional array used for?
-
Store multiple values under one identifier
-
Store one value only
-
Store network routes only
-
Render 3D models only
Question 18
What is a record used for?
-
Store related fields about one item
-
Store only one character
-
Encrypt all variables
-
Sort lists automatically
Question 19
What does a range check do in validation?
-
It checks that data is within set limits
-
It checks spelling only
-
It checks internet speed
-
It checks file size only
Question 20
What is a syntax error?
-
Code that breaks language rules
-
Using slow hardware
-
Choosing weak passwords
-
Having unsorted input data
Question 21
What does type casting do?
-
Converts a value to another data type
-
Encrypts a value for storage
-
Sorts values into order
-
Deletes invalid values automatically
Question 22
What does string concatenation do?
-
Joins strings together
-
Splits a string into characters
-
Converts text to binary
-
Counts the length of a string