On 07/10/2018 11:03 PM, Mats Wichmann wrote:
On 07/10/2018 09:09 PM, Steven D'Aprano wrote:
On Tue, Jul 10, 2018 at 09:46:57PM -0500, Jim wrote:
Say I have a list like ltrs and I want to print out all the possible 3
letter combinations. I want to combine letters from each inner list but
not
On 07/10/2018 10:09 PM, David Rock wrote:
On Jul 10, 2018, at 22:04, David Rock wrote:
On Jul 10, 2018, at 21:46, Jim wrote:
ltrs = [['A', 'B'], ['C', 'D', 'E'], ['F', 'G', 'H', 'I']]
A fairly straightforward way is to use nested loops:
for l in ltrs[0]:
... for j in ltrs[1]:
...
> On Jul 10, 2018, at 22:04, David Rock wrote:
>
>> On Jul 10, 2018, at 21:46, Jim wrote:
>>
>> ltrs = [['A', 'B'], ['C', 'D', 'E'], ['F', 'G', 'H', 'I']]
>
> A fairly straightforward way is to use nested loops:
>
for l in ltrs[0]:
> ... for j in ltrs[1]:
> ... for k in ltrs[2]:
On Tue, Jul 10, 2018 at 09:46:57PM -0500, Jim wrote:
> Say I have a list like ltrs and I want to print out all the possible 3
> letter combinations. I want to combine letters from each inner list but
> not combine any letters within the inner list itself. So ACF and ADF
> would be ok but ABC
> On Jul 10, 2018, at 21:46, Jim wrote:
>
> ltrs = [['A', 'B'], ['C', 'D', 'E'], ['F', 'G', 'H', 'I']]
A fairly straightforward way is to use nested loops:
>>> for l in ltrs[0]:
... for j in ltrs[1]:
... for k in ltrs[2]:
... print l,j,k
A C F
A C G
A C H
A C I
A D F
A D G
A D H