NEW
Font size
WorksheetsAP CSP Groups & Lists
Total questions: 21
Worksheet time: 10mins
What is the first value of c in the for loop?
saddleBrown
pink
0
1
Look at line 28. What is the value of len(app.colors)
Impossible to tell
5
4
How would we complete the statement in line 23 to set color equal to the last element in app.colors?
color = app.colors.last
color = app.colors[len(app.colors)] - 1
color = app.colors[len(app.colors)]
color = app.colors[len(app.colors) - 1]
What are the possible outcomes of the statement
index % 5
1,2,3,4,5
0,1,2,3,4
0,1,2,3,4,5
infinity
Which of the following expressions evaluate to true when index is a multiple of 5?
index % 5 == 1
index % 5 == 2
index % 5 == 0
index % 5 == 5
Upon 1 mouse click, how many times with the loop on line 57 execute?
4 times - once for each leaf in leaves
8 times - once for each child in leaf
1 time
What does line 54 do ?
adds a head to the app group
adds a head to the app.snake group
adds a head to the app list
adds a head to the app.snake list
How many cabbages will be drawn?
1
10
6
5
7
What will the x coordinate be of the first cabbage drawn?
10
100
1
0
What is used to separate elements in a list?
Bracket
Comma
Full Stop
Space
What will this print to the screen?
print(3*4)
3*4
12
7
error
names = ['anne','ralph', 'jeff', 'lauren', 'sim','peter']
How do you remove 'sim' from the list?
names.(6)
names.delete('sim')
names.remove('sim')
names.append('sim')
days = 5
if days > 6:
print(“Month”)
else:
print(“Week”)
What is the index number for 'Spain'?
['England','Brazil','Spain','France']
0
1
2
3
What does the '#' allow you to do?
Repeat code
Comment on code
Print code
End code
If list=[10,20,30,40,50] then list[2]=35 will result
[35,10,20,30,40,50]
[10,20,30,40,50,35]
[10,20,35,40,50]
[10,35,30,40,50]
If list=[17,23,41,10] then list.append(32) will result
[32,17,23,41,10]
[17,23,41,10,32]
[10,17,23,32,41]
[41,32,23,17,10]
What is the output of program below?
mariana_islands = ['Saipan', 'Tinian', 'Rota']
mariana_islands.remove('Tinian')
print(mariana_islands)
['Saipan', 'Tinian', 'Rota']
['Tinian', 'Rota']
['Saipan', 'Tinian']
['Saipan', 'Rota']
1,2,3,4
