[EMAIL PROTECTED] (JP. Baker) writes:
> How *should* I create a sequence of N empty lists (buckets)?
a = [[] for i in xrange(N)]
--
http://mail.python.org/mailman/listinfo/python-list
Diez B. Roggisch wrote:
seq = [[] for i in xrange(10)]
And the reason you need that approach is given in the FAQ:
http://www.python.org/doc/faq/programming.html#how-do-i-create-a-multidimensional-list
It's a very good idea to read the entire FAQ as soon as you've gotten
past the very basic Python l
seq = [[] for i in xrange(10)]
--
Regards,
Diez B. Roggisch
--
http://mail.python.org/mailman/listinfo/python-list
I give up (and have prepared myself for replies telling
me which search strings to use on Google etc)!
How *should* I create a sequence of N empty lists (buckets)?
I obviously can't use
a = [[]]*N
and I have found various solutions and am currently using
a = map(lambda x: [], range(N))
but ca