On Mar 6, 2005, at 09:49, Dave S wrote:
so I thought I would be clever with ...
>>> a=[0]*5
>>> a
[0, 0, 0, 0, 0]
>>> b=[a[:]]*5
same problem.
It seems realy simple but how do I generate a 7 x 75 list matrix ?
Dave
Try this:
>>> a = [''] * 5
>>> b = [a[:] for i in range(5)]
>>> b
[['', '', '',
Jeff Shannon wrote:
On Sun, 06 Mar 2005 09:49:43 +, Dave S <[EMAIL PROTECTED]> wrote:
I need to generate a list 2d matrix of the kind ...
[['', '', '', '', ''], ['', '', '', '', ''], ['', '', '', '', ''], ['',
'', '', '', ''], ['', '', '', '', '']]
except its dimensions need to be 7 x 75. I
On Sun, 06 Mar 2005 09:49:43 +, Dave S <[EMAIL PROTECTED]> wrote:
> I need to generate a list 2d matrix of the kind ...
>
> [['', '', '', '', ''], ['', '', '', '', ''], ['', '', '', '', ''], ['',
> '', '', '', ''], ['', '', '', '', '']]
>
> except its dimensions need to be 7 x 75. I thought
Hello,
I need to generate a list 2d matrix of the kind ...
[['', '', '', '', ''], ['', '', '', '', ''], ['', '', '', '', ''], ['',
'', '', '', ''], ['', '', '', '', '']]
except its dimensions need to be 7 x 75. I thought I had it sorted with
map2 = [ [''] *7 ] *75
until the coding screwed up & I