Font size
WorksheetsPython - Lists and Elements
Total questions: 10
Worksheet time: 5mins
What is the correct command to define a list?
list = [ , , , ]
list == [ , , , ]
list = ( , , , )
list = , , , ,
list = [5, 3, 7, 3, 8, 9]
Which element is the list is represented by list[4]?
7
3
8
9
list = [5, 3, 7, 3, 8, 9]
Which element is the list is represented by list[-1]?
5
3
8
9
What is the output for this code?
num = [ 1, 2, 5 ]
val = [ 5, 6, 7 ]
total = num + val
print(total)
[1, 2, 5, 5, 6, 7]
[1, 2, 5, 6, 7]
[5, 6, 7, 1, 2, 5]
[1, 5, 2, 6, 5, 7]
pic = ["movie", "jpeg", "selfie", "meme"]
What is generated by the command
print( pic[ :3] ) ?
["movie", "jpeg"]
["movie", "jpeg", "selfie"]
["movie", "jpeg", "selfie", "meme"]
["meme"]
What is the output for this code?
red = [122, 123, 128, 129]
red[2] = 140
print(red)
[140, 140]
[122, 123, 129, 140]
[122, 140, 128, 129]
[122, 123, 140, 129]
What is the output for this code?
food = ["bread", "cake", "donuts"]
print(food.append("biscuit"))
['bread', 'cake', 'biscuit']
['bread', 'cake', 'donuts', 'biscuit']
['biscuit']
['bread', 'biscuit', 'donuts']
What is the correct output for this code?
list = [4, 5, 9, 5, 8, 12]
print(list.remove(5))
[4, 9, 5, 8, 12]
[4, 9, 8, 12]
[4, 5, 9, 8, 12]
[4, 5, 9, 5, 8, 12, 5]
What is the output of this code?
front = [9, "ahead", True, 9, "top"]
print(front.count(9))
0
4
3
2
What are the names of Koelmo's cats?
Tom
Bartholomew
Mario
Jerry
