by BlastRoom
Students create Python lists, read and change items by index from 0, use append and len, and trace loops that go through a list.
#computing#ict#cambridge_computing#cambridge_computing_stage_8
20 questions
One question set, multiple game modes. Tap any game to see it in action. Not sure which to pick?
What is a list in Python?
Which line creates a Python list?
What is the index of the first item in a Python list?
colours = ["red", "green", "blue"]. What is colours[1]?
colours = ["red", "green", "blue"]. What is colours[-1]?
Which list method adds an item to the end of a list?
pets = ["cat", "dog"], then pets.append("fish"). What is pets now?
What does len(["a", "b", "c", "d"]) give?
scores = [5, 8, 2], then print(scores[3]). What happens?
A list called names holds 6 items. What is the index of the last item?
Which line prints the third item of a list called team?
nums = [4, 7, 1], then nums[0] = 9. What is nums now?
marks = [12, 15, 9]. What does print(marks[0] + marks[2]) show?
total = 0, then for n in [3, 4, 5]: total = total + n. What is total after the loop?
names has 3 items. Which values does i take in for i in range(len(names)):?
count = 0, then for s in [12, 7, 15, 10]: if s > 10: count = count + 1. What is count?
Why would a programmer store 30 test scores in one list instead of 30 separate variables?
items = ["pen", "ruler"], then items.remove("pen"). What is items now?
What does print("pen" in ["pen", "book"]) show?
shopping = []. What is len(shopping)?
Outrun the horde and crack the passcode.
Pick a tile, answer, hit bonuses and steals.