: >>> XXX = map( lambda x: map (lambda x: [x]*4, [0]*4), [0]*4)
: >>> XXX[1][2][3] = 123
: >>> XXX
: [[[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], [[0, 0, 0,
: 0], [0, 0, 0 , 0], [0, 0, 0, 123], [0, 0, 0, 0]], [[0, 0, 0, 0], [0,
: 0, 0, 0], [0, 0, 0, 0], [0 , 0, 0, 0]], [[0, 0, 0, 0], [0, 0, 0, 0],
: [0, 0, 0, 0], [0, 0, 0, 0]]]
Say, would someone mind explaining to me what exactly that says? I know
what map(), [x]*4, etc do, but what is
lambda x: [x]*4, [0]*4
^^^^^ <-- this part doing?
And how does it all fit together?
-- Tim Gilbert <> gilbert@marin.cc.ca.us <> College of Marin, S.F. Bay Area-- Tim Gilbert <> gilbert@marin.cc.ca.us <> College of Marin, S.F. Bay Area