[BangPypers] partial flattening of list

Vikram kpguy at rediffmail.com
Tue Jul 27 08:48:05 CEST 2010


have the following:

>>> x
[['NM100', 1, 2], ['NM100', 3, 4], ['NM200', 5, 6]]
>>> for i in x:
...   print i
... 
['NM100', 1, 2]
['NM100', 3, 4]
['NM200', 5, 6]

------
how does one obtain list z such that 

z = [['NM100',1,2,3,4],['NM200',5,6]]


More information about the BangPypers mailing list