the most efficient method of adding elements to the list

alf ask at me
Mon Jun 5 23:27:26 EDT 2006


Hi,

Would it be .append()? Does it reallocate te list with each apend?

l=[]
for i in xrange(n):
       l.append(i)


Thx, A.



More information about the Python-list mailing list