import sound

def total_right(snd):
    '''Return the sum of all the values of the samples in the right channel of
    sound.Sound snd.'''
    
    # New concept: an "accumulator".  A variable
    # that builds up an value over time.
    total = 0
    for sample in snd:
        # do something
        right_amount = sound.get_right(sample)
        total = total + right_amount
    return total

if __name__ == "__main__":
    print total_right(sound.load_sound("jingle.wav"))
