Re: More list building

2016-05-12 Thread Peter Otten
louis.a.r...@gmail.com wrote: > On Wednesday, May 11, 2016 at 1:22:09 PM UTC-4, DFS wrote: >> Have: >> p1 = ['Now', 'the', 'for', 'good'] >> p2 = ['is', 'time', 'all', 'men'] >> >> want >> [('Now','is','the','time'), ('for','all','good','men')] >> >> This works: >> >> p = [] >> for i in xrange(

Re: More list building

2016-05-12 Thread marco . nawijn
On Wednesday, May 11, 2016 at 7:22:09 PM UTC+2, DFS wrote: > Have: > p1 = ['Now', 'the', 'for', 'good'] > p2 = ['is', 'time', 'all', 'men'] > > want > [('Now','is','the','time'), ('for','all','good','men')] > > This works: > > p = [] > for i in xrange(0,len(p1),2): > p.insert(i,(p1[i],p2[i

Re: More list building

2016-05-11 Thread louis . a . russ
On Wednesday, May 11, 2016 at 1:22:09 PM UTC-4, DFS wrote: > Have: > p1 = ['Now', 'the', 'for', 'good'] > p2 = ['is', 'time', 'all', 'men'] > > want > [('Now','is','the','time'), ('for','all','good','men')] > > This works: > > p = [] > for i in xrange(0,len(p1),2): > p.insert(i,(p1[i],p2[i