Possible Duplicate:
Some built-in to pad a list in python
I have a method that will return a list (instance variable) with 4 elements. Another method is used to assign values to the list.
But at the moment I can't guarantee that the list has 4 elements when it's asked for, so I want to fill it up with 0's.
Is there a way to fill it with 0's other than say a loop?
for i in range(4 - len(self.myList)): self.myList.append(0)