def paden(lst, len_, pad=0):
    """
    Pad lst to contain at least len_ items by adding pad to the end.
    """
    diff = len_ - len(lst)
    diff = 0 if diff < 0 else diff
    return lst + [pad] * diff