how to build arbitrarily-sized lists in one fell swoop?

Moshe Zadka moshez at math.huji.ac.il
Tue Jul 25 10:28:06 EDT 2000


On Tue, 25 Jul 2000, Samuel Scarano wrote:

> There's a simple thing I want to do in python but I can't find a way that is
> obvious to the reader and efficient for the interpreter. I want to make a
> list with n copies of x.

l = [x]*n

--
Moshe Zadka <moshez at math.huji.ac.il>
There is no IGLU cabal.
http://advogato.org/person/moshez





More information about the Python-list mailing list