padTo (
n,
seq,
default=None,
)
Pads a sequence out to n elements,
filling in with a default value if it is not long enough.
If the input sequence is longer than n, raises ValueError.
Details, details:
This returns a new list; it does not extend the original sequence.
The new list contains the values of the original sequence, not copies.
Exceptions
|
|
ValueError, "%d elements is more than %d." %( len( seq ), n )
|
|