d = [''.join(x) for x in itertools.product(a, b, c)] -- Dhruv Baldawa (http://www.dhruvb.com)
On Fri, Sep 13, 2013 at 4:53 PM, Suyash Bhatt <bhatt.suy...@gmail.com>wrote: > Hi all, > > i need help in finding the most optimized way of making a list using > itertools. > > Suppose I have 3 lists: > > *a=[‘my1’,’my2’] > * > > ** > > *b=[‘name1’,’name2’]* > > *c=[‘is1’]* > > I want to iter through all and form another list with the following > appended strings: > > *d=['my1name1is1','my1name2is1','my2name1is1','my2name2is1']* > > Can this be done in a single line using the itertools module?? > > > Regards, > > Suyash > _______________________________________________ > BangPypers mailing list > BangPypers@python.org > https://mail.python.org/mailman/listinfo/bangpypers > _______________________________________________ BangPypers mailing list BangPypers@python.org https://mail.python.org/mailman/listinfo/bangpypers