test = [1,2] for i in range(5 - len(test) + 1): test.append([]) print(test)