"Mark Tolonen" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
|
| <[EMAIL PROTECTED]> wrote in message
| news:[EMAIL PROTECTED]
| > Hallo,
| >
| > I'm after
| >
| > 
[[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]],[[],[],[],[],[]]]
| >
|
| How about:
|
| >>> [[[]]*5]*5
| [[[], [], [], [], []], [[], [], [], [], []], [[], [], [], [], []], [[], 
[],
| [], [], []], [[], [], [], [], []]]

Because that is actually only 1, not 25, empty lists
>>> a=[[[]]*5]*5
>>> a[0][0].append('ha')
>>> a
[[['ha'], ['ha'], ['ha'], ['ha'], ['ha']], [['ha'], ['ha'], ['ha'], ['ha'], 
['ha']], [['ha'], ['ha'], ['ha'], ['ha'], ['ha']], [['ha'], ['ha'], ['ha'], 
['ha'], ['ha']], [['ha'], ['ha'], ['ha'], ['ha'], ['ha']]]

tjr



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to