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 | |
|---|---|---|
| 1samples = [0, 5, 9, 5, 0, -5] | A[2, 8, 2] is not [8, 2, 2] | |
| 2samples[0] | BA sample sequence of six whole numbers: the wave rises to a peak of 9, falls back to 0, then drops below the middle line. | |
| 3Plotting the samples in order and joining the dots redraws an approximation of the sound wave. | Cplot(samples) # join the dots in order | |
| 4Order matters: the same numbers in a different order make a different wave. | DThe first sample in the list. Counting starts at 0, so this is one volume measurement at the very start of the sound. | |
| 5plot([5, 0, 9, 0, 5]) | EThe samples were recorded as 0, 5, 9, 5, 0 but plotted in a mixed-up order, so the wave shape is lost. Plot them in the recorded order. | |
| 6samples = [0, 4.5, 9, 4.5, 0] | FSamples are whole numbers (integers), so 4.5 is not allowed. Each measurement is rounded to a whole number, such as 4 or 5. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
sample sequence — An ordered list of whole numbers, each measuring a sound's volume at a regular time. Plot them in order and join the dots to redraw an approximation of the wave.samples = [2, 6, 9, 6, 2]
print(samples[0])samples = [4, 8, 4, 0, 4]
count = len(samples)samples = [1, 5, 9, 5, 1]
for s in samples:
plot(s)for i in range(len(samples)):
plot(i, samples[i])samples = [0, 4, 8, 4, 0]
if samples[0] == 0:
print("starts silent")