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 | |
|---|---|---|
| 1score = 0 | AThis works out an answer but never stores it. Without score = at the start, score does not change, so it does not match 'change score by 1'. | |
| 2score = score + 1 | BDoes the same job as the Scratch block 'change score by 1'. Python works out score + 1 first, then stores the answer back in score. | |
| 3The Scratch block 'change score by -1' takes one point away from score. | Cscore = score + 1 | |
| 4Python works out the right side of an assignment first, using the old value of score, and then saves the answer in score. | DA double equals sign compares values and asks a question. It does not set score. Use a single equals sign to match 'set score to 0'. | |
| 5score + 1 | EDoes the same job as the Scratch block 'set score to 0'. It puts the starting value 0 into the variable score. | |
| 6score == 0 | Fscore = score - 1 |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
score = score + 1 — Python for the Scratch block 'change score by 1'. Python works out the right side first, then stores the answer back in score. Use score = 0 to set it.score = 0score = score + 1score = score - 1score = 0
score = score + 1# change score by 5
score = score + 5