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 = {"name": "Ava", "age": 15, "mark": 88.5} | AA record definition that lists each field name and its data type | |
| 2Record Student: name String, age Integer, mark Float | Bmarks = [88, 74, 91] student = {"name": "Mia", "mark": 91} | |
| 3A record holds one item, so you need one record per student | Cstudent1 = {"name": "Ava", "age": 15} student2 = {"name": "Liam", "age": 16} | |
| 4An array holds values of the same type, but a record can mix data types | DTwo students are crammed into one record by repeating a field. Each student needs their own record. | |
| 5student = {"name": "Noah", "age": "sixteen"} student["age"] + 1 | EThe age field holds text instead of an integer, so maths on it fails. Store it as the integer 16. | |
| 6students = {"name": "Zoe", "name": "Leo", "age": 15} | FA record for one student that groups a text field, an integer field and a decimal field |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
record — A structure that groups related fields of different data types to describe one thing, such as a student's name (text), age (integer) and mark (decimal).student = {"name": "Ava", "age": 15}
print(student["name"])student = {"name": "Ava", "mark": 87.5}
print(type(student["mark"]))roster = [{"name": "Zoe"}, {"name": "Leo"}]
print(roster[1]["name"])student = {"name": "Ava", "age": 15}
print(len(student))student = {"name": "Ava", "age": 15}
for field in student:
print(field)