how to fill a list with 0 using python
Why not just:
a = a + [0]*(maxLen - len(a))
Use itertools repeat.
>>> from itertools import repeat
>>> a + list(repeat(0, 6))
['a', 'b', 'c', 0, 0, 0, 0, 0, 0]
Why not just:
a = a + [0]*(maxLen - len(a))
Use itertools repeat.
>>> from itertools import repeat
>>> a + list(repeat(0, 6))
['a', 'b', 'c', 0, 0, 0, 0, 0, 0]