10. Build a Drum Machine

Putting it all together

A function can take another function as an input. Pass kick itself (no parentheses) and your function can play whichever drum you hand it.

🎯 0/4 · 🥁 0 solved · 🏅 0

Challenge A:Make def play(drum, pattern): that loops over the pattern and calls drum(i + 1) wherever there's an "x". Then call play(kick, "x...x...").

Goal
kick
1234
5678