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 | |
|---|---|---|
| 1tk.Label(root, text='Score: 0') | AlblOutput.config(text=str(total)) | |
| 2lblResult.config(text='Total: 25') | BChanges the existing label so it now shows Total: 25 | |
| 3Style a label with a font and a text colour | CCreates a label in the window that displays the text Score: 0 | |
| 4Show a calculated result in a label after a calculation | Dtk.Label(root, text='Hi', font=('Arial', 16), fg='blue') | |
| 5lblResult = tk.Label(root, 'Hello') | EThe text is not given using the text= option, so the label does not know it is the text to show. Use text='Hello'. | |
| 6lblResult.config(text=total) lblResult.text = 'Done' | FSetting .text directly does not change the label. Use lblResult.config(text='Done') to update what it shows. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
tk.Label(root, text='...') — Creates a tkinter label that shows text in the window. Use .config(text=...) to change what it shows, such as displaying a result. Options like font and fg set style.lbl = tk.Label(root, text='Score: 0')lbl = tk.Label(root, text='Welcome')result = 7 * 6
lbl.config(text=result)lbl = tk.Label(root, text='Hi', fg='red')lbl = tk.Label(root, text='Hi',
font=('Arial', 16))