4. Objects Working Together

An object that holds objects

Bigger programs are objects inside objects. A DrumMachine keeps a list of Track objects and has methods to add, find and play them.

🎯 0/4 · 🥁 0 solved · 🏅 0

Challenge A:Finish DrumMachine: def add(self, track): appends to self.tracks, and def play_all(self): plays every track. Add kick [1, 5] and snare [3, 7] and play_all().

Goal
snare
kick
1234
5678