WorksheetsQuick LIsts Recap
Total questions: 12
Worksheet time: 6mins
What would be printed?
x = [3, 4, 7, 9]
print( x[1] )
3
4
7
9
What would be printed?
x = [3, 4, 7, 9]
x.pop(3)
print( x )
[4, 7, 9]
[3, 7, 9]
[3, 4, 9]
[3, 4, 7]
What would be printed?
x = [3, 4, 7]
x.append(1)
print( x )
[1, 3, 4, 7]
[3, 4, 7, 1]
[31, 41, 71]
What would be printed?
x = [3, 4, 7]
x.append(1)
x.sort()
print( x )
[1, 3, 4, 7]
[3, 4, 7, 1]
[31, 41, 71]
What is the missing word so that [ 4, 6, 8, 10 ] is printed?
x = [2, 4, 6, 8, 10]
x.____(2)
print(x)
pop
remove
append
sort
What is the missing word so that [ 2, 4, 8, 10 ] is printed?
x = [2, 4, 6, 8, 10]
x.____(2)
print(x)
pop
remove
append
sort
What is the missing word so that [ 2, 4, 6, 8, 10 ] is printed?
x = [2, 4, 6, 8]
x.____(10)
print(x)
pop
remove
append
sort
What is the missing word so that [1, 2, 3] is printed?
z = [3, 2, 1]
___.sort()
print( z )
nums
z
list
What is the difference between pop() and remove()? Select all correct statements.
pop() takes an item out of a list using its position
pop() takes an item out of a list using its value
remove() takes an item out of a list using its value
remove() takes an item out of a list using its position
What should be where the '??' is in the code below:
x = [5, 9, 2, 3]
x.sort??
print("The smallest is", x[0])
( )
[ ]
.
Nothing
What should replace the '??' in the code below?
p = [ "Red", "Blue", "Green" ]
print("Grass is", ??)
p(2)
p[2]
p[3]
p(3)
What would be printed?
x = [3, 4, 7, 9]
x.remove(3)
print( x )
[4, 7, 9]
[3, 7, 9]
[3, 4, 9]
[3, 4, 7]
