> On Jul 10, 2018, at 21:46, Jim <jf_byr...@comcast.net> 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
A D I
A E F
A E G
A E H
A E I
B C F
B C G
B C H
B C I
B D F
B D G
B D H
B D I
B E F
B E G
B E H
B E I


Not the most elegant, but probably the easiest to follow.

— 
David Rock
da...@graniteweb.com




_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to