alf wrote:
> Hi,
> 
> Would it be .append()? Does it reallocate te list with each apend?
> 
> l=[]
> for i in xrange(n):
>       l.append(i)
> 

<dumb>
FWIW, you'd have the same result with:
l = range(n)
</dumb>


More seriously (and in addition to other anwsers): you can also
construct a list in one path:

  l = [i for i in xrange(n)]

or if you want operations and conditionals :

  l = [trasform(i) for i in xrange(n) if match_some_cond(i)]



HTH
-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to