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 | |
|---|---|---|
| 1range(1.5, 10) | AOutput: [0, 1, 2] | |
| 2for i in range(5, 1): print(i) | BError: range() needs integers | |
| 3range(2, 8, 2) | COk: Counts down 5,4,3,2,1 | |
| 4range(5, 0, -1) | DError: No output — step needed | |
| 5print(list(range(3))) | EOutput: [1, 2, 3, 4, 5] | |
| 6print(list(range(1,6))) | FValid: 2, 4, 6 |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
range(stop) — Creates numbers from 0 up to but not including stop.~~range(start, stop)for i in range(5):
print(i)for i in range(1, 6):
print(i) # prints 1,2,3,4,5for i in range(0, 10, 2):
print(i) # counts by 2for i in range(5, 0, -1):
print(i) # counts downfor i in range(1, 6):
print(i) # starts at 1