Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

T-Level DPDD: Array Concepts Quiz

Total questions: 22

Worksheet time: 11mins

Name
Class
Date
1.

What is an array element in the context of arrays?

a)

A collection of arrays

b)

An index value

c)

A single data 'bucket' in an array

d)

The name of the array

2.

What is the starting index value in an array?

a)

1

b)

0

c)

-1

d)

10

3.

What is the identifier of an array?

a)

The index value

b)

The data type

c)

The name of the array

d)

The array element

4.

What is a key difference between arrays and lists?

a)

Arrays can contain elements of different types

b)

Lists have a fixed size

c)

Arrays are homogeneous

d)

Lists start indexing at 1

5.

Which of the following is NOT true about arrays?

a)

Arrays can store different data types

b)

Arrays start indexing at 0

c)

Each element in an array has an index value

d)

Arrays are homogeneous

6.

What is the primary advantage of using arrays in terms of memory storage?

a)

They are stored in contiguous memory.

b)

They can store multiple data types.

c)

They are stored in non-contiguous memory.

d)

They are more complex to implement.

7.

What is the biggest disadvantage of arrays?

a)

They restrict items to a single data type.

b)

They are not space-efficient.

c)

They are difficult to implement.

d)

They cannot store numerical data.

8.

Which module needs to be imported to work with arrays in Python?

a)

array

b)

list

c)

numpy

d)

math

9.

What does the 'i' in array.array('i', [1, 2, 3, 4, 5]) denote?

a)

An integer type

b)

A float type

c)

A string type

d)

A boolean type

10.

Which of the following is NOT a requirement for creating an array in Python?

a)

Using the import array statement

b)

Calling the array module and then the array function within it

c)

Using square and round brackets to create the array

d)

Using a semicolon to separate elements

11.

How can you access the first element of an array named myNumbers in Python?

a)

myNumbers[1]

b)

myNumbers[0]

c)

myNumbers.first()

d)

myNumbers[-1]

12.

What method is used to add a new entry to an array in Python?

a)

add()

b)

insert()

c)

append()

d)

push()

13.

How can you modify the first element of an array named myNumbers to 0 in Python?

a)

myNumbers[0] = 0

b)

myNumbers[1] = 0

c)

myNumbers.modify(0, 0)

d)

myNumbers.update(0, 0)

14.

Which method is used to remove an item with the value 3 from an array named myNumbers in Python?

a)

delete(3)

b)

remove(3)

c)

pop(3)

d)

discard(3)

15.

What does the count() function do in an array?

a)

Counts the number of times a value occurs in a list.

b)

Removes an item at the specified index.

c)

Inserts an item at the specified index location.

d)

Checks to see if an item is not in a list.

16.

Which function removes an item at the specified index in an array?

a)

count()

b)

pop()

c)

insert()

d)

in

17.

What is the result of myNumbers.pop(0) if myNumbers initially contains [1, 2, 3, 4, 5, 6]?

a)

[2, 4, 5, 6]

b)

[1, 2, 3, 4, 5, 6]

c)

[2, 3, 4, 5, 6]

d)

[1, 3, 4, 5, 6]

18.

What does the insert() function do in an array?

a)

Counts the number of times a value occurs in a list.

b)

Removes an item at the specified index.

c)

Inserts an item at the specified index location.

d)

Checks to see if an item is not in a list.

19.

What is the result of the expression "45 not in myNumbers" if myNumbers does not contain 45?

a)

True

b)

False

c)

45

d)

None

20.

Which of the following statements is true about arrays?

a)

Arrays can hold multiple types of data.

b)

Arrays are not indexed.

c)

Arrays are contained in adjacent memory locations in RAM.

d)

Arrays do not require importing any module in Python.

21.

What must you do to use arrays in Python?

a)

Nothing special, arrays are built-in.

b)

Import the array module.

c)

Use the list module.

d)

Use the dictionary module.

22.

How can you loop through an array in Python?

a)

Using a while loop.

b)

Using a for loop.

c)

Using a do-while loop.

d)

Using a switch statement.