3. Slicing

Taking part of a list

beats[1:3] slices out the items from position 1 up to (not including) 3. Leave a side blank to go to the edge: beats[:4] is the first four, beats[4:] is the rest. A third number is a step: beats[::2] is every other item.

🎯 0/4 · 🥁 0 solved · 🏅 0

Challenge A:beats = [1, 2, 3, 4, 5, 6, 7, 8]. Play the hihat on just the first four with beats[:4].

Goal
hihat
1234