I have a list of size < N and I want to pad it up to the size N with a value.
Certainly, I can use something like the following, but I feel that there sh
To go off of kennytm:
def pad(l, size, padding): return l + [padding] * abs((len(l)-size)) >>> l = [1,2,3] >>> pad(l, 7, 0) [1, 2, 3, 0, 0, 0, 0]