Re: itertools query

2019-09-28 Thread Peter Otten
> Pradeep Patra wrote: > My idea is to include the last element of array a and first element of second array b in the final array. fr.append((a[-1], b[0])) -- https://mail.python.org/mailman/listinfo/python-list

Re: itertools query

2019-09-27 Thread Pradeep Patra
I don't need other combination except 6,7 On Saturday, September 28, 2019, Piet van Oostrum wrote: > Pradeep Patra writes: > > > Hi all, > > > > I have written a small program to generate all the combinations of a and > b > > of the array. I want (6,7) tuple also included. Can anybody suggest

Re: itertools query

2019-09-27 Thread Piet van Oostrum
Pradeep Patra writes: > Hi all, > > I have written a small program to generate all the combinations of a and b > of the array. I want (6,7) tuple also included. Can anybody suggest what > change I should make to get 6,7 included in my output? Any suggestions > Why (6,7)? What about (5,7), (5,8)

Re: itertools query

2019-09-27 Thread Peter Otten
Pradeep Patra wrote: > Hi all, > > I have written a small program to generate all the combinations of a and b > of the array. I want (6,7) tuple also included. Can anybody suggest what > change I should make to get 6,7 included in my output? Any suggestions The spec is not clear to me. If you

itertools query

2019-09-27 Thread Pradeep Patra
Hi all, I have written a small program to generate all the combinations of a and b of the array. I want (6,7) tuple also included. Can anybody suggest what change I should make to get 6,7 included in my output? Any suggestions Output: [(5,), (6,), (5, 6), (7,), (8,), (7, 8)] from itertools