3. Look It Up Safely

in and .get()

Looking up a key that isn't there is an error. Check first with if "tom" in song:, or use song.get("tom", default) to get a backup value when it's missing.

🎯 0/4 · 🥁 0 solved · 🏅 0

Challenge A:song has no "tom". If "tom" in song, play tom(song["tom"]); else play the crash on 1. Play the kick part either way.

Goal
crash
kick
1234
5678