dumb newbie list question
dalke at acm.org
Sun Aug 19 20:39:11 CEST 2001
>>Is there an easy way to do this without building a
>> second list of the right size and concatenating them?
>Why will you do this?
>works fine and should be faster then many l.append('x')
If you don't want to create a new list, you could also do
l.extend( [None] * (10-len(l)) )
(Using None is closer to the way Perl does it than using 'x'.)
More information about the Python-list