Lie Ryan wrote: > mattia wrote:
>> Yes, sorry, I have to recycle! But how about this: >>>>> rw = [[2,4], [4,5,6],[5,5]] >>>>> rw += [[1,1]]*2 >>>>> rw >> [[2, 4], [4, 5, 6], [5, 5], [1, 1], [1, 1]] >> How can I recicle in this way using append? > > Not .append() but .extend() Whether you use items += [item]*N or items.extend([item]*N) is mostly a matter of style. You can avoid the intermediate list with items.extend(itertools.repeat(item, N)) but I don't think this approach is faster. Peter -- http://mail.python.org/mailman/listinfo/python-list