On 07/10/2018 10:09 PM, David Rock wrote:


On Jul 10, 2018, at 22:04, David Rock <da...@graniteweb.com> wrote:

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


Sorry, let’s try to make that a little cleaner-looking

for x in ltrs[0]:
   for y in ltrs[1]:
     for z in ltrs[2]:
       print x,y,z


Seeing it in front of me it does look straight forward, I was having difficulty visualizing how to solve it.

thanks, Jim


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

Reply via email to