Some built-in to pad a list in python,a += [''] * (N - len(a))