wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Multidimensional list and tuples 2025

Total questions: 44

Worksheet time: 44mins

Name
Class
Date
1.

Pam is working on a Python project, and she discovered that both tuples and lists in her code can contain a heterogeneous sequence of elements. Is this statement correct?

a)

True

b)

False

2.

What will print when this code executes?

a)

<class 'tuple'>

b)

<class 'list'>

c)

<class 'set'>

d)

<class 'dict'>

3.

What will print when this code executes?

a)

<class 'tuple'>

b)

<class 'list'>

c)

<class 'set'>

d)

<class 'dict'>

e)

<class 'int'>

4.

What will print when this code executes?

a)

<class 'tuple'>

b)

<class 'list'>

c)

<class 'set'>

d)

<class 'dict'>

e)

<class 'int'>

5.

What will print when this code executes?

a)

<class 'tuple'>

b)

<class 'list'>

c)

<class 'set'>

d)

<class 'dict'>

e)

<class 'int'>

6.

What will print when this code executes?

a)

<class 'tuple'>

b)

<class 'list'>

c)

<class 'set'>

d)

<class 'dict'>

7.

What will print when this code executes?

a)

<class 'tuple'>

b)

<class 'list'>

c)

<class 'set'>

d)

<class 'dict'>

8.

What will print when this code executes?

a)

Donatello

b)

Michelangelo

c)

Raphael

d)

Leonardo

9.

What will print when this code executes?

a)

Donatello

b)

Michelangelo

c)

Raphael

d)

Leonardo

10.

Regarding the properties of lists and tuples, which statement is accurate?

a)

Both lists and tuples can be modified after creation.

b)

Only lists can be modified after creation, tuples cannot.

c)

Both lists and tuples cannot be modified after creation.

d)

Only tuples can be modified after creation, lists cannot.

11.

What will print when this code executes?

a)

Donatello

b)

Michelangelo

c)

Raphael

d)

Leonardo

12.

What will print when this code executes?

a)

Donatello

b)

Michelangelo

c)

Raphael

d)

Leonardo

13.

What will print when this code executes?

a)

Donatello

b)

Michelangelo

c)

Raphael

d)

Leonardo

14.

What will print when this code executes?

a)

Donatello

b)

Michelangelo

c)

Raphael

d)

Leonardo

15.

What will print when this code executes?

a)

(1, 2, 3)

b)

(4, 5, 6)

c)

(7, 8, 9)

d)

(10, 11, 12)

e)

0

16.

Tuples in Python are mutable

a)

False

b)

True

17.

What will print when this code executes?

a)

(1, 2, 3)

b)

(4, 5, 6)

c)

(7, 8, 9)

d)

(10, 11, 12)

e)

-2

18.

Which of the following statements correctly describes the mutability of lists and tuples in Python?

a)

Lists are immutable, while tuples are mutable.

b)

Lists are mutable, while tuples are immutable.

c)

Both lists and tuples are mutable.

d)

Neither lists nor tuples are mutable.

19.

What will print when this code executes?

a)

3

b)

5

c)

6

d)

9

e)

11

20.

What will print when this code executes?

a)

3

b)

6

c)

8

d)

10

e)

9

21.

What will print when this code executes?

a)

1

b)

4

c)

7

d)

6

e)

9

22.

What will print when this code executes?

a)

3

b)

4

c)

7

d)

10

e)

9

23.

What will print when this code executes?

a)

[4, 5, 6]

b)

[7, 8, 9]

c)

7

d)

2

e)

[10, 11, 12]

24.

What will print when this code executes?

a)

[4, 5, 6]

b)

[7, 8, 9]

c)

7

d)

2

e)

[10, 11, 12]

25.

What will print when this code executes?

a)

[4, 5, 6]

b)

4

c)

7

d)

2

e)

10

26.

What will print when this code executes?

a)

3

b)

cat

c)

12

d)

turtle

e)

15

27.

What will be the output for the program above?

a)

<class 'tuple'>

b)

<class 'list'>

c)

<class 'set'>

d)

<class 'dict'>

28.

What will be the output for the program above?

a)

<class 'tuple'>

b)

<class 'list'>

c)

<class 'set'>

d)

<class 'dict'>

29.

What would this code show on the screen?

a)

7

b)

6

c)

5

d)

4

e)

An error

30.

What is the correct order for accessing elements in a 2D array?

a)

[row][column]

b)

[column][row]

31.

Which of the following code snippets will print 20 to the screen, given this list:

my_list=[[2,4,6,8],[1,3,5,7],[0,10,20,30]]

a)

print(my_list[2][2])

b)

print(my_list[1][3])

c)

print(my_list[0][2])

d)

print(my_list[2][1])

32.

What will be the output if the programmer wrote the command:

print(my_data[1][1][1])

a)

2

b)

11

c)

22

d)

8

33.

Which of the following code snippets will print 7 to the screen, given this list:

my_list=[[2,4,6,8],[1,3,5,7],[0,10,20,30]]

a)

print(my_list[1][3])

b)

print(my_list[0][1])

c)

print(my_list[2][0])

d)

print(my_list[1][2])

34.

Which would be the correct code to access number 10

a)

list_2d[3][4]

b)

list_2d= [2,3]

c)

list_2d[2][3]

d)

list_2d(0,0)

35.

Which would be the correct code to access number 4

a)

list_2d[1][3]

b)

list_2d= [1,2]

c)

list_2d[1][1]

d)

list_2d(1,3)

36.

What will print when this code executes?

a)

fish

b)

cat

c)

dog

d)

turtle

e)

hamster

37.

Which of the list below has the dimensions of 3 X 2 X 3?

a)

b)

c)

d)

38.

Which of the list below has the dimensions of 9 X 2?

a)

b)

c)

d)

39.

Which of the list below has the dimensions of 3 X 3 X 2?

a)

b)

c)

d)

40.

Which of the list below has the dimensions of 3 X 2 X 2?

a)

b)

c)

d)

41.

Which of the list below has the dimensions of 3 X 4 ?

a)

b)

c)

d)

42.

Which of the list below has the dimensions of 4 X 3 ?

a)

b)

c)

d)

43.

Which of the list below has the dimensions of 2 X 6 ?

a)

b)

c)

d)

44.

Which of the list below has the dimensions of 6 X 2 ?

a)

b)

c)

d)