wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

2D Lists and Arrays

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

Is this a List or an Array?

I can store multiple values of different data types

a)

List

b)

Array

2.

Is this a List or an Array?

Once made it's impossible to change the number of elements I store.

a)

List

b)

Array

3.

Is this a List or an Array?

I cannot store values of different data types. I can only store multiple pieces of data when they are the same data type.

a)

List

b)

Array

4.

Is this a List or an Array?

I am an infinite data structure - I can take many additional values once I've been created.

So you can add as many elements to me as you want.

a)

List

b)

Array

5.

What is the number of the index of the first value in a list?

a)

0

b)

1

c)

2

d)

start

6.

An index is ...

a)

A number given to each value in a list to show it's position in the list.

b)

A number assigned to every value in the list to say how many characters it contains.

c)

A number assigned to every list.

d)

A letter given to each value in a list to show it's position in the list.

7.

Fruits = [["Apple","Pear","Orange"],["Grape","Pineapple",'Pen"]]

How many rows are in the 2D list above?

a)

0

b)

1

c)

2

d)

3

8.

Fruits = ["Apple","Pear","Orange","Grape","Pineapple",'Pen"]

What will be displayed if I type in:

print(Fruits[2])

a)

Orange

b)

Apple

c)

Pear

d)

Grape

9.

Fruits = [["Apple","Pear","Orange"],["Grape","Pineapple",'Pen"]]

How many columns are in the 2D list above?

a)

0

b)

1

c)

2

d)

3

10.

Fruits = [["Apple","Pear","Orange"],["Grape","Pineapple",'Pen"]]

What is the element in Fruits[2][1]?

a)

Grape

b)

Pineapple

c)

Nothing, It doesn't exist

d)

Orange

11.

When talking about lists, what does append mean?

a)

Add a value to the end of a list

b)

Add a value to the begining of a list

c)

Add the word pen to a list

d)

Print out the list

12.

What does this line of code do?

Fruits.reverse()

a)

Reverse the order of a list

b)

Put a list into alphabetical order

c)

Put a list into numerical order

d)

Doesn't do anything a list

13.

What does this line of code do?

Fruits.sort()

a)

Reverse the order of a list

b)

Put a list into alphabetical order

c)

Put a list into numerical order

d)

Doesn't do anything a list

14.

prime_numbers = [2, 3, 5, 7, 9, 11]

prime_numbers.remove(9)

print(prime_numbers)

What would be displayed?

a)

2,3,5,7,11

b)

2,3,5,7,9,11

c)

2,1,3,5,7,9,11

d)

2,3,5,7,9,11,9

15.

What does the following code do:

List.Clear()

a)

Removes all elements from a list

b)

Removes all duplicated values from a list

c)

Removes all even indexes from a list

d)

Removes nothing from a list