for loops and range()
A for loop repeats code. for b in range(1, 5): runs the indented lines once for each number 1, 2, 3, 4 — with b holding that number each time.
🔢 Math connection: range(1, 9, 2) skip counts by 2 from 1: 1, 3, 5, 7. Those are the odd numbers. RockBlocks Math: Grade 2 · Odd and Even Numbers ↗
Challenge A:Play the hihat on beats 1-4 with a loop instead of four lines. range(1, 5) counts 1, 2, 3, 4 — it stops just before 5.