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 | |
|---|---|---|
| 1button.onClick(save_score) | ABrings in a library of ready-made code, such as map features, so the app does not need to build them | |
| 2import maps_library | Bscreen.add(Label('Score'), Button('Play')) | |
| 3An object holds data (attributes) and behaviour (methods) together | Cplayer = Player('Ava', 120) player.add_points(10) | |
| 4A screen is made from interface controls such as labels and buttons that the user sees and taps | DThe object's data is mixed up: a text value is added to a number, which causes an error. Score should hold a number, such as player.score = 10 + 5. | |
| 5button.onClick(save_score()) | EThe handler is called straight away because of the brackets, so it runs when the screen loads, not when the user taps. Pass the function name without brackets. | |
| 6player.score = 'ten' + 5 | FAn event handler: when the user taps the button, the save_score function runs |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
app components — The parts that make up a mobile app: interface controls on screens, objects with data and behaviour, event handlers that respond to the user, and libraries of ready-made code.btn = Button(root, text="Go", command=start)class Player:
def __init__(self, name):
self.name = namebtn = Button(root, command=on_tap)import requests
data = requests.get(url)root = Tk()
label = Label(root, text="Score")
root.mainloop()