Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CPM9.1-9.3 Quiz Review

Total questions: 15

Worksheet time: 9mins

Name
Class
Date
1.

In two-dimensional lists, the _____________ is always listed first.

a)

dimension

b)

row

c)

initializer list

d)

column

2.

In Python arrays are also called ______.

a)

elements

b)

rows

c)

lists

d)

string

3.

What is in element [0][0]?

a)

pretzel

b)

undervalue

c)

rational

d)

windmill

4.

What is in element [3][1]?

a)

honey

b)

iron

c)

rational

d)

effort

5.

Two-dimensional lists are used to store data that can be represented in a _____________.

a)

number

b)

string

c)

grid

d)

row

6.

Consider the following code:

grid = []

grid.append (["frog", "cat", "hedgehog"])

grid.append (["fish", "emu", "rooster"])

print (grid[0][1])

What is output?

a)

frog

b)

cat

c)

hedgehog

d)

fish

7.

It is not possible for an array to hold an array.

a)

True

b)

False

8.

Consider the following code:

grid = []

grid.append (["frog", "cat", "hedgehog"])

grid.append (["fish", "emu", "rooster"])

print (grid)

How many rows does this array have?

a)

1

b)

2

c)

3

d)

4

9.

To iterate through (access all the entries of) a two-dimensional arrays you need (a)   for loops. (Enter the number of for loops needed).

10.

An individual piece of data stored in a list is called a(n) (a)   .

11.

Why do we use two for loops with two-dimensional arrays?

a)

One to move over the rows, and one for the columns.

b)

To correctly print out the contents.

c)

Because they can store both numbers and words.

d)

To do number calculations.

12.

A two-dimensional list is

a)

a looped data structure

b)

a boolean

c)

a list of lists

d)

a primitive data type

13.

Consider the code. How many columns does the list have?

a)

1

b)

2

c)

3

d)

4

14.

Consider the code. What are the dimensions of the two-dimensional list?

a)

5x7

b)

4x2

c)

7x5

d)

1x7

15.

In two-dimensional lists the _____________ is always listed second.

a)

dimension

b)

row

c)

initializer list

d)

column