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 | |
|---|---|---|
| 1student = (101, "Ava", 15, 88.5) print(student[1]) | Astudent = (101, "Ava", 15, 88.5) | |
| 2student[0] | Bmark = student[3] | |
| 3Fields in a tuple record are read by index position, not by name, so you must remember the field order | CA tuple record is read by index number, not by field name. Use student[1] to get the name. | |
| 4One record can mix data types, so each index holds a different type: int, string, int, float | DThe ID is the first field, so it sits at index 0, not 1. Indexes start at 0, so use student[0]. | |
| 5student = (101, "Ava", 15, 88.5) print(student["name"]) | EPrints "Ava", the second field, because index 1 is the second position in the tuple record | |
| 6id = student[1] | FReads the first field of the record, which is the ID in this record layout |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
student[1] — Reads a field from a record stored as a tuple by its index position. Indexes start at 0, so student[0] is the first field. You must know which field sits at which index.student = (101, "Ava", 15, 88.5)
print(student[0]) # the IDstudent = (101, "Ava", 15, 88.5)
name = student[1]student = (7, "Liam", 16, 72.5)
print(student[2])student = (101, "Ava", 15, 88.5)
mark = student[3]ID, NAME, SCORE = 0, 1, 2
student = (5, "Zoe", 91.5)
print(student[SCORE])