[BangPypers] nested list help

Jeffrey Jose jeffjosejeff at gmail.com
Wed Jul 28 21:28:04 CEST 2010


On Wed, Jul 28, 2010 at 1:01 PM, Anand Balachandran Pillai <
abpillai at gmail.com> wrote:

> On Tue, Jul 27, 2010 at 7:03 PM, Vikram K <kpguy1975 at gmail.com> wrote:
>
> > Suppose i have this nested list:
> >
> > >>> x
> > [['NM100', 3, 4, 5, 6, 7], ['NM100', 10, 11, 12, 13], ['NM200', 15, 16,
> > 17]]
> > >>> for i in x:
> > ...   print i
> > ...
> > ['NM100', 3, 4, 5, 6, 7]
> > ['NM100', 10, 11, 12, 13]
> > ['NM200', 15, 16, 17]
> > >>>
> >
> > how do i obtain from the above the following nested list:
> >
> > >>> z
> > [['NM100', 3, 4, 5, 6, 7, 10, 11, 12, 13], ['NM200', 15, 16, 17]]
> > >>> for i in z:
> > ...   print i
> > ...
> > ['NM100', 3, 4, 5, 6, 7, 10, 11, 12, 13]
> > ['NM200', 15, 16, 17]
> > >>>
> >
>
> Isn't this the same question you asked in another thread ? Just that
> the list has more members now.
>
>
yeah you're right. The same question was posted elsewhere. I hope the author
responds to the very many replies he got.

>
> > _______________________________________________
> > BangPypers mailing list
> > BangPypers at python.org
> > http://mail.python.org/mailman/listinfo/bangpypers
> >
>
>
>
> --
> --Anand
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>


More information about the BangPypers mailing list