Inputs with default values
def hit(b, hits=1): gives hits a default. Call hit(3) and hits is 1; call hit(3, 4) and it's 4. Defaults make functions easy to use and flexible.
Lesson 1: a roll function with smart defaults.
def roll(start=5, length=4):
for b in range(start, start + length):
tom(b)
roll()
roll(1, 2)Challenge A:Write def hit(b, hits=1): that plays snare(b, hits). Call hit(1) and hit(3, 2).