grkunt...@gmail.com wrote:
I am just learning Python.
I am trying to create a list of empty lists: [[], [], [], ...] (10
items total).
Apart from the solutions shown, why would you do that in the first
place?
Creating such a structure is probably not so pythonic so the way to
create it does n
grkunt...@gmail.com writes:
> I am just learning Python.
>
> I am trying to create a list of empty lists: [[], [], [], ...] (10
> items total).
>
> What is the most Pythonic way to do this?
>
> If I use a list comprehension (as in myList = [[] for item in xrange
> (0, 10)]), Netbeans warns me that
grkunt...@gmail.com wrote:
I am just learning Python.
I am trying to create a list of empty lists: [[], [], [], ...] (10
items total).
What is the most Pythonic way to do this?
If I use a list comprehension (as in myList = [[] for item in xrange
(0, 10)]), Netbeans warns me that 'item' is neve
I am trying to create a list of empty lists: [[], [], [], ...] (10
items total).
What is the most Pythonic way to do this?
If I use a list comprehension (as in myList = [[] for item in xrange
(0, 10)]), Netbeans warns me that 'item' is never used.
Not using Netbeans, I can't verify that the be
I am just learning Python.
I am trying to create a list of empty lists: [[], [], [], ...] (10
items total).
What is the most Pythonic way to do this?
If I use a list comprehension (as in myList = [[] for item in xrange
(0, 10)]), Netbeans warns me that 'item' is never used.
If I use a for-loop