Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Quick LIsts Recap

Total questions: 12

Worksheet time: 6mins

Name
Class
Date
1.

What would be printed?

x = [3, 4, 7, 9]

print( x[1] )

a)

3

b)

4

c)

7

d)

9

2.

What would be printed?

x = [3, 4, 7, 9]

x.pop(3)

print( x )

a)

[4, 7, 9]

b)

[3, 7, 9]

c)

[3, 4, 9]

d)

[3, 4, 7]

3.

What would be printed?

x = [3, 4, 7]

x.append(1)

print( x )

a)

[1, 3, 4, 7]

b)

[3, 4, 7, 1]

c)

[31, 41, 71]

4.

What would be printed?

x = [3, 4, 7]

x.append(1)

x.sort()

print( x )

a)

[1, 3, 4, 7]

b)

[3, 4, 7, 1]

c)

[31, 41, 71]

5.

What is the missing word so that [ 4, 6, 8, 10 ] is printed?

x = [2, 4, 6, 8, 10]

x.____(2)

print(x)

a)

pop

b)

remove

c)

append

d)

sort

6.

What is the missing word so that [ 2, 4, 8, 10 ] is printed?

x = [2, 4, 6, 8, 10]

x.____(2)

print(x)

a)

pop

b)

remove

c)

append

d)

sort

7.

What is the missing word so that [ 2, 4, 6, 8, 10 ] is printed?

x = [2, 4, 6, 8]

x.____(10)

print(x)

a)

pop

b)

remove

c)

append

d)

sort

8.

What is the missing word so that [1, 2, 3] is printed?

z = [3, 2, 1]

___.sort()

print( z )

a)

nums

b)

z

c)

list

9.

What is the difference between pop() and remove()? Select all correct statements.

a)

pop() takes an item out of a list using its position

b)

pop() takes an item out of a list using its value

c)

remove() takes an item out of a list using its value

d)

remove() takes an item out of a list using its position

10.

What should be where the '??' is in the code below:

x = [5, 9, 2, 3]

x.sort??

print("The smallest is", x[0])

a)

( )

b)

[ ]

c)

.

d)

Nothing

11.

What should replace the '??' in the code below?

p = [ "Red", "Blue", "Green" ]

print("Grass is", ??)

a)

p(2)

b)

p[2]

c)

p[3]

d)

p(3)

12.

What would be printed?

x = [3, 4, 7, 9]

x.remove(3)

print( x )

a)

[4, 7, 9]

b)

[3, 7, 9]

c)

[3, 4, 9]

d)

[3, 4, 7]