def strip_and_pad(name):
    """Makes the list 3 digits long.

    If the _name_ list is passed in with more than three digits then
    only the first three digits are kept. If the _name_ list is shorter
    than three digits then the _name_ list is padded with '0' until it
    is three digits long.

    :param name: The name list
    :return: A list that is only 3 digits long.

    """
    if not name:
        return ['0', '0', '0']
    if len(name) > 3:
        name = name[:3]
    elif len(name) < 3:
        while len(name) < 3:
            name.append('0')
    return name
