Am Wed, 23 Jul 2008 08:33:57 -0700 wrote antar2: > I already asked a similar question, but encounter problems with > python... > How can I concatenate the elements in each list of a list of lists > > list_of_listsA = > > [['klas*', '*', '*'], > ['mooi*', '*', '*', '*'], > ['arm*', '*', '*(haar)']] > > wanted result: > > list_of_listsA = > > [['klas* * *'] > ['mooi* * * *'] > ['arm* * *(haar)']] > > Thanks a lot !
Hello, maybe this will help: In [5]: list_of_listsA = [['klas*', '*', '*'], ['mooi*', '*', '*', '*'], ['arm*', '* ', '*(haar)']] In [6]: s = "" In [7]: print [[s.join(item)] for item in list_of_listsA] [['klas***'], ['mooi****'], ['arm** *(haar)']] regards Michael -- http://mail.python.org/mailman/listinfo/python-list