WorksheetsT-Level DPDD: Array Concepts Quiz
Total questions: 22
Worksheet time: 11mins
What is an array element in the context of arrays?
A collection of arrays
An index value
A single data 'bucket' in an array
The name of the array
What is the starting index value in an array?
1
0
-1
10
What is the identifier of an array?
The index value
The data type
The name of the array
The array element
What is a key difference between arrays and lists?
Arrays can contain elements of different types
Lists have a fixed size
Arrays are homogeneous
Lists start indexing at 1
Which of the following is NOT true about arrays?
Arrays can store different data types
Arrays start indexing at 0
Each element in an array has an index value
Arrays are homogeneous
What is the primary advantage of using arrays in terms of memory storage?
They are stored in contiguous memory.
They can store multiple data types.
They are stored in non-contiguous memory.
They are more complex to implement.
What is the biggest disadvantage of arrays?
They restrict items to a single data type.
They are not space-efficient.
They are difficult to implement.
They cannot store numerical data.
Which module needs to be imported to work with arrays in Python?
array
list
numpy
math
What does the 'i' in array.array('i', [1, 2, 3, 4, 5]) denote?
An integer type
A float type
A string type
A boolean type
Which of the following is NOT a requirement for creating an array in Python?
Using the import array statement
Calling the array module and then the array function within it
Using square and round brackets to create the array
Using a semicolon to separate elements
How can you access the first element of an array named myNumbers in Python?
myNumbers[1]
myNumbers[0]
myNumbers.first()
myNumbers[-1]
What method is used to add a new entry to an array in Python?
add()
insert()
append()
push()
How can you modify the first element of an array named myNumbers to 0 in Python?
myNumbers[0] = 0
myNumbers[1] = 0
myNumbers.modify(0, 0)
myNumbers.update(0, 0)
Which method is used to remove an item with the value 3 from an array named myNumbers in Python?
delete(3)
remove(3)
pop(3)
discard(3)
What does the count() function do in an array?
Counts the number of times a value occurs in a list.
Removes an item at the specified index.
Inserts an item at the specified index location.
Checks to see if an item is not in a list.
Which function removes an item at the specified index in an array?
count()
pop()
insert()
in
What is the result of myNumbers.pop(0) if myNumbers initially contains [1, 2, 3, 4, 5, 6]?
[2, 4, 5, 6]
[1, 2, 3, 4, 5, 6]
[2, 3, 4, 5, 6]
[1, 3, 4, 5, 6]
What does the insert() function do in an array?
Counts the number of times a value occurs in a list.
Removes an item at the specified index.
Inserts an item at the specified index location.
Checks to see if an item is not in a list.
What is the result of the expression "45 not in myNumbers" if myNumbers does not contain 45?
True
False
45
None
Which of the following statements is true about arrays?
Arrays can hold multiple types of data.
Arrays are not indexed.
Arrays are contained in adjacent memory locations in RAM.
Arrays do not require importing any module in Python.
What must you do to use arrays in Python?
Nothing special, arrays are built-in.
Import the array module.
Use the list module.
Use the dictionary module.
How can you loop through an array in Python?
Using a while loop.
Using a for loop.
Using a do-while loop.
Using a switch statement.
