wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python L1 Quiz 4: Lists

Total questions: 10

Worksheet time: 28mins

Name
Class
Date
1.

True or False: The index 1 identifies the first element in a list.

a)

True

b)

False

2.

True or False: Lists can only contain integers.

a)

True

b)

False

3.

What will always be the index of the last item in a list?


(You may select multiple answers)

a)

-0

b)

-1

c)

0

d)

The size of the list minus 1

4.

Which code will print cat?


(You may select multiple answers)

a)

print(my_list[1])

b)

print(my_list[2])

c)

print(my_list[-2])

d)

print(my_list[-3])

5.

Which index will get the first item in a list?


(You may select multiple answers)

a)

0

b)

1

c)

the size of the list, as a negative number

d)

-1

6.

What is the output of the following code?


arr = [10, 20, 30, 40, 50, 60]

print(len(arr))ㅤㅤㅤㅤㅤㅤ

a)

0

b)

6

c)

5

d)

SyntaxError

7.

What is the output of the following code?


value = [[10, 20, 30], [40, 50, 60]]

print(len(value))ㅤㅤㅤㅤㅤㅤㅤ

a)

2

b)

3

c)

6

d)

0

8.

What is the output of the following code?


value = [[10, 20, 30], [40, 50, 60]]

print(len(value[0]))ㅤㅤㅤㅤㅤㅤ

a)

2

b)

3

c)

6

d)

0

9.

Which function will add an item to a list?

a)

my_list.add(item)

b)

my_list.append(item)

c)

my_list.concat(item)

d)

my_list.insert(item)

10.

Which function will delete an item from a list?

a)

my_list.remove(item)

b)

my_list.delete(item)

c)

my_list.del(item)

d)

my_list.remv(item)