[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Re: brain stuck. whats occurring here?

Robin Becker

2/7/2008 6:02:00 PM

Matthew_WARREN@bnpparibas.com wrote:
> Hallo,
>
> I'm after
>
> [[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]]]
>
> (NxN 'grid', 5x5 in that example, and while typing this up i figured out
> how to get it, but I'm still not sure what _was_ happening)
>
>
> I'm trying
>
>>>>> a=[]
>>>> row=[ [] for n in range(0,10) ]
>>>> a.extend(row[:])
>>>> a
> [[], [], [], [], [], [], [], [], [], []]
>>>> a[0].extend(row[:])
>>>> a
> [[[...], [], [], [], [], [], [], [], [], []], [], [], [], [], [], [], [],
> [], []]
>
>
> why isnt that last a
>
> [[[...]],[],[],[],[],[],[],[],[],[]]
>
>
> Puzzled :)
>
> Matt.
> --
.........

To get an n by m grid I would use

[[[] for i in xrange(m)] for j in xrange(n)]


--
Robin Becker

2 Answers

Michael Ejercito

10/5/2013 12:52:00 AM

0


"CUNTICA" <brianlambskysbignose@yahoo.com> wrote in message
news:l2mmig$i20$3@news.mixmin.net...
> On 10/3/2013 10:22 PM, Michael Ejercito wrote:
>> "John Manning" <jrobertm@terra.com.br> wrote in message
>> news:oeWdncCoJ4Caf9DPnZ2dnUVZ_sCdnZ2d@giganews.com...
>>> The Republicans who swept to power in 1994
>>> were the first House and Senate delegations that
>>> reflected the party?s new center of power in the
>>> *white South*
>>>
>> You are a racist as well as a buggerist.
>
> He's anti-white. A whigger.
I wonder why he would be anti-white.


Michael


NEMO

10/5/2013 1:03:00 AM

0

On 10/4/2013 5:51 PM, Michael Ejercito wrote:
> "CUNTICA" <brianlambskysbignose@yahoo.com> wrote in message
> news:l2mmig$i20$3@news.mixmin.net...
>> On 10/3/2013 10:22 PM, Michael Ejercito wrote:
>>> "John Manning" <jrobertm@terra.com.br> wrote in message
>>> news:oeWdncCoJ4Caf9DPnZ2dnUVZ_sCdnZ2d@giganews.com...
>>>> The Republicans who swept to power in 1994
>>>> were the first House and Senate delegations that
>>>> reflected the party?s new center of power in the
>>>> *white South*
>>>>
>>> You are a racist as well as a buggerist.
>>
>> He's anti-white. A whigger.
> I wonder why he would be anti-white.

He's one of those self-hating whites who wishes he was black so that he
could be part of the downtrodden minority.