Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python List Methods

Total questions: 10

Worksheet time: 4mins

Name
Class
Date
1.

What is the index number for 'Spain'?

['England','Brazil','Spain','France']

a)

0

b)

1

c)

2

d)

3

2.

How do i remove something from a list?

a)

variable.append()

b)

variable.delete()

c)

variable.remove()

d)

variable=(new variable)

3.

variable.sort() will do what?

a)

Sort the list into alphabetical order

b)

Sort the list into reverse order

c)

Create a new list

d)

Error

4.

What does the '#' allow you to do?

a)

Repeat code

b)

Comment on code

c)

Print code

d)

End code

5.

If list=[10,20,30,40,50] then list[2]=35 will result

a)

[35,10,20,30,40,50]

b)

[10,20,30,40,50,35]

c)

[10,20,35,40,50]

d)

[10,35,30,40,50]

6.

If list=[17,23,41,10] then list.append(32) will result

a)

[32,17,23,41,10]

b)

[17,23,41,10,32]

c)

[10,17,23,32,41]

d)

[41,32,23,17,10]

7.

What is the output of program below?


mariana_islands = ['Saipan', 'Tinian', 'Rota']

mariana_islands.remove('Tinian')

print(mariana_islands)

a)

['Saipan', 'Tinian', 'Rota']

b)

['Tinian', 'Rota']

c)

['Saipan', 'Tinian']

d)

['Saipan', 'Rota']

8.

What is the output of program below?


mariana_islands = ['Saipan', 'Tinian', 'Rota', 'Guam']

mariana_islands.sort()

print(mariana_islands)

a)

['Tinian', 'Saipan', 'Rota', 'Guam']

b)

['Guam', 'Tinian', 'Rota', 'Saipan']

c)

['Saipan', 'Rota', 'Guam', 'Tinian']

d)

['Guam', 'Rota', 'Saipan', 'Tinian']

9.

Look at the following code, what will it generate

a)

1,2,3,4,5,6,7,8,9,10,11,12

b)

0,1,2,3,4,5,6,7,8,9,10,11,12

c)

1,2,3,4,5,6,7,8,9,10,11,12,13

d)

0,1,2,3,4,5,6,7,8,9,10,11,12,13

10.
a)
b)
c)
d)

1,2,3,4