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 | |
|---|---|---|
| 1break | AError: print never reached | |
| 2for i in range(5): continue print(i) | BOk: Skips printing 2 | |
| 3for i in range(5): if i == 3: break | COutput: 0 1 2 | |
| 4for i in range(5): if i == 2: continue print(i) | DValid: break exits at i==3 | |
| 5for i in range(5): if i == 3: break print(i) | EOutput: 0 1 3 | |
| 6for i in range(4): if i == 2: continue print(i) | FError: break outside loop |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
break — Immediately exits the entire loop.~~continuefor i in range(10):
if i == 5:
break
print(i)for i in range(10):
if i == 3:
continue
print(i)while True:
x = input('Enter: ')
if x == 'quit':
breakfor i in range(10):
if i % 2 == 0:
continue
print(i)for i in range(20):
if i == 10:
break
print(i)