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)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.