def padTo(n, seq, default=None):
 if (len(seq) > n):
  raise ValueError(('%d elements is more than %d.' % (len(seq), n)))
 blank = ([default] * n)
 blank[:len(seq)] = list(seq)
 return blank

def padTo ( n , seq , default = None ) : if ( len ( seq ) > n ) : raise ValueError ( ( '%d elements is more than %d.' % ( len ( seq ) , n ) ) ) blank = ( [ default ] * n ) blank [ : len ( seq ) ] = list ( seq ) return blank
pads a sequence out to n elements .