1. More Choices: elif

if / elif / else

elif (short for "else if") adds more choices. Python checks each condition from the top and runs only the first one that's true — then skips the rest.

Lesson 1: if / elif / else picks a drum for every beat.

for b in range(1, 9):
    if b % 4 == 1:
        kick(b)
    elif b % 4 == 3:
        snare(b)
    else:
        hihat(b)
The beat it plays
hihat
snare
kick
1234
5678
…and in RockBlocks
Hi-Hat (Closed)
Snare Drum
Bass Drum
🎯 0/4 · 🥁 0 solved · 🏅 0

Challenge A:Loop beats 1-4: crash on beat 1, snare on beat 3, and the hihat on every other beat. Use if / elif / else.

Goal
crash
hihat
snare
1234