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 | |
|---|---|---|
| 1while True: | AScratch repeat until done means keep going until done is true, so the loop needs not. This loop would stop at the start while done is False. Use while not done: | |
| 2while not done: | Bwhile not score == 10: score = score + 1 | |
| 3A forever block that stops when the player presses q can be written with break inside a while True loop | CThe Python version of Scratch repeat until done. It keeps looping while done is still False and stops once done becomes True. | |
| 4Scratch repeat until score = 10 becomes a while loop that uses not | DTrue needs a capital T in Python. Writing true gives a NameError because Python does not know that name. Use while True: | |
| 5while true: print("Go!") | EThe Python version of the Scratch forever block. It repeats the indented code nonstop until a break stops it. | |
| 6while done: print("Working") | Fwhile True: key = input() if key == "q": break |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
while True: — The Python version of the Scratch forever block. It repeats its indented code nonstop until break. Scratch repeat until x becomes while not x:while True:
print("Hello!")while True:
print("Go!")done = False
while not done:
done = Truewhile True:
if score >= 10:
breaklives = 3
while not lives == 0:
lives = lives - 1