def padlist(container, size, default=None):
 return (list(container)[:size] + ([default] * (size - len(container))))

def padlist ( container , size , default = None ) : return ( list ( container ) [ : size ] + ( [ default ] * ( size - len ( container ) ) ) )
pad list with default elements .