7. Functions That Decide

Returning choices

A function can make a decision and return the answer — which drum, how many hits, is this a fill? Then the main loop just asks.

🎯 0/4 · 🥁 0 solved · 🏅 0

Challenge A:def drum_for(b): return snare if b % 2 == 0 else kick. Loop 1-8 calling drum_for(b)(b).

Goal
snare
kick
1234
5678