Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1scores = [85, 92, 78] | AA list: an ordered collection of values that you can loop through and change | |
| 2ages = {"Mia": 15, "Leo": 14} | BA dictionary: look up a value quickly using its key | |
| 3A tuple is best for a fixed group of values that should not change, like a map point | CA list is indexed by position, not by name. To look up by a key, use a dictionary instead. | |
| 4A list of dictionaries is best for storing records, where each dictionary holds one item's details | Dstudents = [{"name": "Mia", "year": 9}] | |
| 5colours = ("red", "blue") colours.append("green") | Epoint = (10, 25) | |
| 6phone = ["Mia", "0412 345 678"] print(phone["Mia"]) | FA tuple cannot be changed, so append() causes an error. Use a list if the values need to grow. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
list, dict, tuple — Pick the structure by how you use the data: a list for an ordered collection, a dict for lookup by key, and a tuple for a fixed group of values that should not change.ages = {"Mia": 15, "Leo": 16}
print(ages["Mia"])rgb = tuple([255, 128, 0])kids = [{"age": 9}, {"age": 12}]
print(kids[0]["age"])stock = {"apple": 4, "pear": 7}
print(stock.get("pear"))names = ["Zoe", "Sam", "Ali"]
for name in names:
print(name)