One-step multiples list generation?

Efrat Regev efrat_regev at yahoo.com
Tue Jan 3 12:50:42 EST 2006


   Hello,

   Suppose I have some non-numerical Foo and would like to create a list 
of 20 Foo-s. Is there a one-step method (not a loop) of doing so? E.g., 
something like [Foo * 20] (which is obviously not the right way) that 
would create [Foo, Foo, Foo, ...,Foo].
   I tried looking through the docs, FAQs and help, but couldn't find 
anything (the closest is range, but it seems it's only for numerics) - I 
very much appreciate your time in answering. Also, please excuse me if I 
used some wrong terminology.

   Thanks,

   Efrat



More information about the Python-list mailing list